Jump to:

2076 Posts in 857 Topics by 449 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » Cannot click on Change Country without checking T&Cs

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 2
Go to End
Author Topic: 2371 Views
  • Double-A-Ron
    Avatar
    Community Member
    599 Posts

    Re: Cannot click on Change Country without checking T&Cs Link to this post

    And if you have the GeoIP library installed on your server (nothing to do with SS) you can go a step further and auto select your visitor's country (based on their IP with an accuracy of around 96% apparently)

    new DropdownField('Country', 'Please choose your country', Geoip::getCountryDropDown(), Geoip::visitor_country())

    Aaron

  • imsas
    Avatar
    Community Member
    22 Posts

    Re: Cannot click on Change Country without checking T&Cs Link to this post

    Hey guys,

    I see you have same problem I solve this.

    First need decorate form class, to effect validators. In ecommerce its all good, but form does not have Processing() function and beforeProcessing() never was in touch.

    Soliution (ecommerce OrderForm.php line: ~112):
    1. Replace "function beforeProcessing()" => "function validate()"
    2. Replace "return parent::beforeProcessing()" => "return parent::validate()"

    function validate() {      
          if(isset($_REQUEST['action_useDifferentShippingAddress']) || isset($_REQUEST['action_useMemberShippingAddress'])){
             return true;
          }
          else return parent::validate();
       }

  • merrick_sd
    Avatar
    Community Member
    89 Posts

    Re: Cannot click on Change Country without checking T&Cs Link to this post

    Is it possible to have a country selected initially?

    i have a dropdown for Shipping
       new DropdownField('ShippingCountry', 'Please choose your country', Geoip::getCountryDropDown()),

    i would like United Kingdom to be selected by default is that possible? if so how

  • merrick_sd
    Avatar
    Community Member
    89 Posts

    Re: Cannot click on Change Country without checking T&Cs Link to this post

    SS 2.3.4

    I have payment class

    I am validating credit card.

    function getPaymentFormRequirements() {
             return array(
                "js" => "
                
                   require('CreditCardNumber');
                
                ",
                "php" => '
                   
                   $this->requireField("CreditCardNumber", $data);
                
                ',
             );
       }

    I want to disable this though ..if they click change Change Country .. else you'd have to:

    step1 input credit card , tick terms / conditions
    step2 click change country
    Step3 change your country and save
    step4: re tick terms / conditions and re input credit card details
    step4 : submit

    PS: I need to keep the change country as it is because I have differing shipping options, so changing country to a pulldown hasn't worked for me.

    If this is not possible i would us jQuery to validate card client side, but for that i'd need 1field I think not 4 inputs.
    as i was planning on using this http://www.ihwy.com/Labs/jquery-validate-credit-card-extension.aspx maybe as people say validate on credit card isn't correct?

    2371 Views
Page: 1 2
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.