Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Shipping country/state behavior is perfect, make billing the same?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-21-2009, 10:55 PM
 
necroflux necroflux is offline
 

Advanced Member
  
Join Date: Feb 2009
Posts: 47
 

Thumbs up Shipping country/state behavior is perfect, make billing the same?

Right now in the shipping address section, when a customer chooses a country, the state list automatically populates with the states that are listed as part of that country in the database, and if there are no such states a "no states available for this country" message fires and the field becomes not-required.

Then why does the billing address section work differently? Why does every state for every country get listed in the dropdown box, when the most obvious and organized way to handle this has already been programmed and implemented in the other section?

My main question is: How can I get the billing address country/state selection to work in the same was as the shipping address? I've tried looking at change_states.js but it's far too complex for me to figure out what's going on to simply change a few variables.

Thanks!
__________________
-----------------
X-cart version 4.2.1
Reply With Quote
  #2  
Old 05-21-2009, 11:22 PM
 
necroflux necroflux is offline
 

Advanced Member
  
Join Date: Feb 2009
Posts: 47
 

Default Re: Shipping country/state behavior is perfect, make billing the same?

Figured it out, and is it a weird solution:

In $X-cart_dir/skin1/customer/main/register_billing_address.tpl:

Find and CUT:

Code:
{if $default_fields.b_state.avail eq 'Y' && $default_fields.b_country.avail eq 'Y' && $js_enabled eq 'Y'} <tr style="display: none;"> <td> {include file="main/register_states.tpl" state_name="b_state" country_name="b_country" county_name="b_county" state_value=$userinfo.b_state|default:$config.General.default_state county_value=$userinfo.b_county} </td> </tr> {/if}

Take that code you just snipped and paste it AFTER the following:

Code:
{if $reg_error ne "" and $userinfo.b_country eq "" and $default_fields.b_country.required eq 'Y'}<span class="error-message">&lt;&lt;</span>{/if} </td> </tr> {/if}

Boom - you've got the same functionality in the shipping AND billing sections. Why was this not the default?
__________________
-----------------
X-cart version 4.2.1
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:03 PM.

   

 
X-Cart forums © 2001-2020