17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 3296 Views |
-
ecommerce default country

16 October 2007 at 12:37pm
first, thanks for a fantastic piece of open source software.
second, after much searching, I am unable to find where the ecommerce module defaults to "new zealand" for the country in the code. I would like to change it, but can't seem to locate where to change it.
thanks in advance
-
Re: ecommerce default country

16 October 2007 at 5:15pm
Hi there,
Thanks for the kind words.
I believe what you're after is this line of code new DropdownField('Country', 'Country', Geoip::getCountryDropDown(), self::findCountry()). It can be viewed in the source browser at:
http://open.silverstripe.com/browser/modules/ecommerce/trunk/code/EcommerceRole.php
Change your EcommerceRole.php in your site so that the 4th argument to the DropdownField self::findCountry() is removed. This should stop the country dropdown from populating a default country. If there are any other instances of the site where a country is defaulting, just do a search on all ecommerce php files for findCountry() or Geoip::visitor_country( in all files.
Originally this was in place so if you're a member, it used your member's country as the default in the dropdown. Otherwise, if you're not a member, or the country hasn't been set in your member preferences, it attempts to find what country you're from based on IP address.
Hope this helps!
Cheers,
Sean -
Re: ecommerce default country

16 October 2007 at 11:49pm
Thanks for the quick reply Sean!
I will dig into the code tonight. I appreciate the help.
Keep up the good work.
-
Re: ecommerce default country

24 September 2008 at 9:54pm
Hi Sean, Instead of just eliminating the self::findCountry() code is it possible to actually change the default from 'New Zealand' to another country?
Thanks in advance.
-
Re: ecommerce default country

4 October 2008 at 6:54am Last edited: 4 October 2008 6:54am
Briohny,
To change the default country, open sapphire/security/Geoip.php
then put the desired 2 digit country code in line 289...
if(substr($address,0,7)=="192.168" || substr($address,0,4)=="127.") {
// default country updated by Daniel Kratohvil
$code = "US"; // default country
} else {
...regards,
Daniel
| 3296 Views | ||
|
Page:
1
|
Go to Top |




