Jump to:

2084 Posts in 1005 Topics by 453 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: 2539 Views
  • mschiefmaker
    Avatar
    Community Member
    187 Posts

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

    Hi
    I am having a slight problem with the checkout page. If you click on the Change Country button it fails forcing you to check the accepted T&Cs box first and then when it returns you to the form it has removed the check. I kind of get why it removes it but I don't see that you need to read the T&Cs before you change the country you live in. I assume I need to add an option to

    function beforeProcessing() {
          if(isset($_REQUEST['action_ChangeCountry']) || isset($_REQUEST['action_ChangeCountry2']) || isset($_REQUEST['action_useDifferentShippingAddress']) || isset($_REQUEST['action_useBillingAddress'])) {
             return true;
          } else {
             return parent::beforeProcessing();
          }

    in OrderForm.php but I am not sure how. Any ideas?

    Thanks

    MM

  • mschiefmaker
    Avatar
    Community Member
    187 Posts

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

    Any ideas on this, it really is confusing and I would like to remove it.

    Thanks

    Catherine

  • mschiefmaker
    Avatar
    Community Member
    187 Posts

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

    I still haven't solved this and I really don't thing you should have to ticke the T&C b4 you change the country esp when you return to the main form you have to tick the T&Cs again. Surely someone else has fixed this before?

    Thanks

    Catherine

  • Yakiv
    Avatar
    Community Member
    59 Posts

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

    I think the agreement to the terms and conditions is fine, as a check mark, but, I think the link to the actual terms and conditions should be a popup. This may solve your issue. Just a thought.

    (I see you very active here, with the ecommerce plugin. It's good. You are trying to work through issues. I am new to SilverStripe's ecommerce module, so, I am working through the code and the documentation.)

  • mschiefmaker
    Avatar
    Community Member
    187 Posts

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

    Interesting idea but the problem is not with the acutal link to the T&Cs. The issue is two fold:
    1. when I click on the Change Country button, the "t&c are a required field message appears " and I can't use the Change COuntry Button until I check the T&Cs box,
    2. then having returned from the Change Country screen the T&C checkbox is unchecked again.

    Ideally I would like to remove the need to going to a seperate screen to select a different country by replacing the change country button with a dropdown list on the country field, this would remove the validation issue and would also remove the issue of not being able to get the country to default when you you remove the members login option and usean anonomous purchase process but as the code that creates this form is quite comlex I have struggled with this.

    Cheeers

    Catherine

  • Double-A-Ron
    Avatar
    Community Member
    604 Posts

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

    Hi Cath,

    I had a play with this and I removed that field from my custom ecommerce installation on my last project, replacing it with a dropdown. My code for this is at work, but basically it's just a matter of modifying the constructor on OrderForm.php.

    I just installed oscommerce in my sandbox out of curiosity on that method you posted. Even the comment above it says:

       /**
        * Disable the validator when you're calling ChangeCountry
        */

    Which is exactly what it's not doing for you. Adding some quick debug code to that method proves it's not being fired. Not on 2.3.3 at least. OrderForm extends Form, which is located in /sapphire/forms/ and a text search in that file shows the method doesn't exist.

    Just did a quick check for "beforeProcessing" in trac. Looks like a known bug. http://open.silverstripe.org/ticket/4055. It seems beforeProcessing used to work, but no longer. May have been superceded by validate() or just removed from core.

    There appears to be a patch for it too, so try add this code to OrderForm.php: http://open.silverstripe.org/attachment/ticket/4055/OrderForm_validationPatch.diff or try download the latest ecommerce trunk.

    Aaron

  • mschiefmaker
    Avatar
    Community Member
    187 Posts

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

    Thanks Aaron removed the code in OrderForm.php for the Change country field and added

    $countryField = new CountryDropdownField (
    $name = "country",
    $title = "Please choose your country"
    );   

    and I now have a dropdown instead. Much better for my needs

    Thanks

    Catherine

  • Double-A-Ron
    Avatar
    Community Member
    604 Posts

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

    How are you populating that dropdown Cath?

    You can use this to autopopulate the countries for you:

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

    Aaron

    2539 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.