Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

catalog/address_book_process.php


TCwho

Recommended Posts

Posted

Hey everyone,

 

Been racking my brains for like the past hour trying to change the sort order of the fields ...when a customer chooses to update their address book..

 

I want to put the Zip/Postal Code Field Under the State Field...

 

I have been modifying the code around with no success, and my best attempt was when I moved some code after the If Statement for State:

 

originally from default code from lines 79 - 121

 

I had modified like so from ...just showing after being modified from lines 93 - 126:

    if (ACCOUNT_STATE == 'true') {
     $zone_id = 0;
     $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'");
     $check = tep_db_fetch_array($check_query);
     $entry_state_has_zones = ($check['total'] > 0);
     if ($entry_state_has_zones == true) {
       $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
       if (tep_db_num_rows($zone_query) == 1) {
         $zone = tep_db_fetch_array($zone_query);
         $zone_id = $zone['zone_id'];
       } else {
         $error = true;

         $messageStack->add('addressbook', ENTRY_STATE_ERROR_SELECT);
       }
     } else {
       if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
         $error = true;

         $messageStack->add('addressbook', ENTRY_STATE_ERROR);
       }
     }

     // adding zip after state
    }

    if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
    $error = true;

     $messageStack->add('addressbook', ENTRY_POST_CODE_ERROR);

     // finish changing

   }

 

GRRR... I know I missing it... I know after I am shown the solution....

 

IT WILL SEEM SO SIMPLE :P

Posted

Thank for your compliment in the other thread :blush:

 

You know... I never realized that the state/zip code were in the wrong order on address_book_process.php and it seems my testers didn't catch it either.

 

I don't have access to my test server right now, but I'll take a look at it later tonight. (unless someone else posts an answer first)

 

Robert

Posted

OH yeah, and I didnt mention earlier ... but same problem can also be found in:

 

checkout_payment_address.php

 

checkout_shipping_address.php

 

...for those who may want to fix order and keep order consistant throughout their site... I was able to figure out with the help of Boxtel some time ago how to get the order striaght in the account creation page... I thought that experience was gonna help....

Posted

Check Catalog > Includes > Modules > Address_Book_Details.php

 

Move lines around 82 to 85

<tr>
           <td class="main"><?php echo ENTRY_POST_CODE; ?></td>
           <td class="main"><?php echo tep_draw_input_field('postcode', $entry['entry_postcode']) . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
         </tr>

to just after

if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT;
?></td>
         </tr>

around line 108.

 

Just did it on my test server and it worked (need an smiley for patting self on back) :D

 

Hope this helps,

 

Bob G.

 

P.S. havent tried checkout_payment_address.php or checkout_shipping_address.php yet but I'll take a look.

Installed Contributions: CCGV, Close Popup, Dynamic Meta Tags, Easy Populate, Froogle Data Feeder, Google Position, Infobox Header Entire Row, Live Support for OSC, PayPal Seal with CC images, Report_m Sales, Shop by Price Revised, SQL Updater, Who's Online Enhancement, Footer, GNA EP Assistant and still going.

Posted

Catalog > Includes > Modules > Checkout_Payment_Address.php

 

Move:

 <tr>
   <td class="main"><?php echo ENTRY_POST_CODE; ?></td>
   <td class="main"><?php echo tep_draw_input_field('postcode') . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
 </tr>

 

To just after:

if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT;
?>
   </td>
 </tr>

 

Should take care of checkout_payment_address.php and checkout_shipping_address.php.

 

Bib G.

Installed Contributions: CCGV, Close Popup, Dynamic Meta Tags, Easy Populate, Froogle Data Feeder, Google Position, Infobox Header Entire Row, Live Support for OSC, PayPal Seal with CC images, Report_m Sales, Shop by Price Revised, SQL Updater, Who's Online Enhancement, Footer, GNA EP Assistant and still going.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...