Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

1-country store / default country and remove country field


Reply


3 Posts   658 Views

Avatar
janulka

Community Member, 80 Posts

23 November 2011 at 2:32am

Hello,

I am working on a store, and the products can be shipped to only one country (Norway).

How do I select default Norway value for country field, and at the same time remove country field completely from the checkout / my account page, or even better, display read-only field "country Norway".

And another thing - how do I translate labels "First name" Surname, etc. on check-out page, to Norwegian?

Thank you!

Avatar
Nicolaas

Forum Moderator, 213 Posts

25 November 2011 at 7:23pm

Hi

In our branch of e-commerce (as seen here www.silverstripe-ecommerce.com), we have the following directive (add to mysite/_config):

EcommerceCountry::EcommerceCountry::set_fixed_country_code("NO");

I would also set:

Geoip::$default_country_code = 'NO';

That seems to work for me, and it turns the country drop-down into a read-only field.

Cheers

Nicolaas

Avatar
janulka

Community Member, 80 Posts

29 November 2011 at 10:21pm

Thank you for your reply.

I am really having trouble with this one..

Geoip::$default_country_code = "NO";


does nothing, default country is still Afghanistan

OrderFormWithoutShippingAddress::set_fixed_country_code("NO");


does nothing, default country is still Afghanistan

ShoppingCart::set_fixed_country_code("NO");


is giving Fatal error: Call to undefined method ShoppingCart::set_fixed_country_code()

EcommerceCountry::EcommerceCountry::set_fixed_country_code("NO");


is giving Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM

EcommerceCountry::set_fixed_country_code("NO");


Fatal error: Class 'EcommerceCountry' not found

Help? Thank you