Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Putting United States first in the country list.


bester

Recommended Posts

Is that possible with this script? I rarely sell outside of the United States and have gotten some complaints that it takes too long to scroll down to the US option. I know I can just press "U' a few times to get there, but apparently most people don't.

 

I found a contrib called country state selector, but I'm already using Purchase without account and the readme for CSS tells me to look in the PWA extras folder. This folder does not exist.

Link to comment
Share on other sites

Don't you know, america always comes last, thats its place!!

 

But seriously, make this change:

 

edit includes\functions\html_output.php and amend the following bit to default ALL country LOVs to your shops country.

 

// Creates a pull-down list of countries

function tep_get_country_list($name, $selected = '', $parameters = '') {

 

//add

if ( strlen($selected)==0 ) $selected = STORE_COUNTRY;

//this

 

$countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Sam is exactly correct, but I always say "do it the easiest way ;)"

 

From:

function tep_get_country_list($name, $selected = '', $parameters = '') {

 

To:

function tep_get_country_list($name, $selected = STORE_COUNTRY, $parameters = '') {

Link to comment
Share on other sites

Link to comment
Share on other sites

I can't see either of those working as intended.

 

In Spooks version create_account.php tep_get_country_list('country') is still not passing the $selected parameter

 

In Burts version If I choose a country then get returned to the form it will auto select the STORE_COUNTRY regardless of what I chose previously.

 

Using RC2a code wouldn't it make more sense to do ..

 

				<td class="main"><?php echo ENTRY_COUNTRY; ?></td>
<?php ( isset($HTTP_POST_VARS['country']) ? $countrySelect = $HTTP_POST_VARS['country'] : $countrySelect = STORE_COUNTRY ); ?>
			<td class="main"><?php echo tep_get_country_list('country', $countrySelect) . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>

Link to comment
Share on other sites

I've used that for ages, works fine, with your method you have to find & edit every call.

 

return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);

 

:huh:

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

I've used that for ages, works fine, with your method you have to find & edit every call.

 

return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);

 

:huh:

 

Well it's only in a couple of files.

 

Your method would ensure that the STORE_COUNTRY is always selected but in standard osc code the $selected parameter is not used so if your STORE_COUNTRY is US and I select UK then I get sent back because of an omission US would be selected again which could be quite annoying.

 

I was just suggesting that something like I posted should be in create_account also.

 

Anyway it is all rather irrelevant as there is a superb contribution by stevel called country state selector vs 1.4.1.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...