Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

KISS custom create account


Juto

Recommended Posts

Posted

This requires no change of the db or any other files than catalog/application_top and catalog/create_account.

I prefer to keep things the KISS way and design sites which are fully validated both front- and backend. :)

 

In application top add:

 

define ('DEFAULT_COUNTRY', TRUE); //If TRUE default country equals STORE_COUNTRY. If FALSE the country drop down list will show

 

In create account change the code for country (around line 482 et seq.) drop down to:

 

<!--BOF default country//-->

<?php

if (DEFAULT_COUNTRY == FALSE) {

// Boolean DEFAULT_COUNTRY is defined in application_top.

?>

 

<tr>

<td class="main"><?php echo ENTRY_COUNTRY; ?></td>

<td class="main"><?php echo tep_get_country_list('country') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>

</tr>

 

<?php

} else {

?>

 

<caption><?php echo tep_draw_hidden_field('country',STORE_COUNTRY); ?></caption>

 

<?php

}

?>

<!--EOF default country//-->

 

The reason for using the caption instead of the 'normal' <tr><td>...</td></tr> is that when the required field is hidden, so should the space for it. (It simply looks better).

 

Next step would be (if needed) to do the same for the address fields, leaving the customers name and e-mail address. I haven't done that yet.

I dont think that any version of OScommerce checks if the address fields are the same as the country field.

 

That's all you have to do and it will work like a charm. You can see it in action at www.ji-fashion.com (tip, while you are there click on the category 'historical note').

 

Sara

Archived

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

×
×
  • Create New...