Jump to content


Corporate Sponsors


Latest News: (loading..)

stevel

Member Since 23 Jun 2003
Offline Last Active Jul 20 2011, 11:59
-----

Posts I've Made

In Topic: Country-State Selector

20 July 2011, 12:01

I will comment that if your knowledge of PHP is "very limited", then you will encounter no end of frustration maintaining an osCommerce store. I encourage you to learn enough PHP to understand the code.

In Topic: Country-State Selector

19 July 2011, 22:51

angel, in my version (1.4), this code fetches the state or zone_id value from the submitted form:

    if (ACCOUNT_STATE == 'true') {
      $state = tep_db_prepare_input($HTTP_POST_VARS['state']);
      if (isset($HTTP_POST_VARS['zone_id'])) {
        $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
      } else {
        $zone_id = -1; // Country-State Selector
      }
    }

I have not looked at the AJAX version to see what it does.

In Topic: Country-State Selector

30 June 2011, 12:57

You'll have to debug the PHP - perhaps the form is not being submitted correctly or the code path when the form is submitted has errors. I generally start out by inserting a "var_dump($_POST);" in the form action code to see what was submitted (this will block the later redirect but that's ok.) I then add various echo or var_dump commands through the code until I understand what went wrong.

In Topic: Country-State Selector

28 June 2011, 20:49

What you need to do is change the address format for the US format (which if I recall is format 1 by default.) Unfortunately there is no interface in osC to actually edit these - all you can do is select among the formats defined. The default format spells out the zone name but you want the zone code instead.

I have customized my shops and am away from my sources so what I am about to suggest may not work right for you. Open your database in PHPMyAdmin or whatever you use. Select table address_format. Insert a new row. The address_format_id should be the next value, probably 2. For address_format enter:

$firstname $lastname$cr$streets$cr$city, $statezone $postcode

and for address_summary, enter:

US

Once you have finished adding the record, go into your osC admin, and select Locations/Taxes > Countries. Find the entry for United Stated and edit it. Change the Address Format to 2 (or whatever the new format ID was in the step above.)

Now you will have to enter a new order and see if the address appears correct, oh and you may have to go back in and create a new address book entry as it will have the old code. What I don't remember is if the standard osC code defines $statezone in the tep_format_address function in includes/general.php. I have customized mine to allow for more flexibility as many countries need specialized formats that the default code doesn't support. I have always had in the back of my head the notion of writing an address format contribution with CORRECT formats for all the countries, but it is daunting work to research each country and get the right format. I've done it for maybe 15 countries so far - there are ten times as many.

All that should be needed is for variable $statezone to be defined in the function to be the zone code. If it is not there you should be able to figure out how to add it. Let me know if you run into trouble and I'll help you Sunday or later.

In Topic: ULTIMATE Seo Urls 5 - by FWR Media

23 June 2011, 16:59

I will defer to Robert on this - and will test it on my sites. It may be that search engines are fine - they will simply get the "cookie usage" page if they try to follow a link to a page that requires a session. Of course, you should have such pages listed in robots.txt. On my site, I do not display such links if there is no session.