Jump to:

2088 Posts in 1008 Topics by 455 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » 1-country store / default country and remove country field

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

Page: 1
Go to End
Author Topic: 555 Views
  • janulka
    Avatar
    Community Member
    80 Posts

    1-country store / default country and remove country field Link to this post

    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!

  • Nicolaas
    Avatar
    Forum Moderator
    213 Posts

    Re: 1-country store / default country and remove country field Link to this post

    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

  • janulka
    Avatar
    Community Member
    80 Posts

    Re: 1-country store / default country and remove country field Link to this post

    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

    555 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.