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

Cannot click on Change Country without checking T&Cs


Go to End
Reply

12 Posts   2583 Views

Avatar
mschiefmaker

24 September 2009 at 12:17pm Community Member, 187 Posts

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

Avatar
mschiefmaker

20 October 2009 at 6:41pm Community Member, 187 Posts

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

Thanks

Catherine

Avatar
mschiefmaker

29 November 2009 at 10:12pm Community Member, 187 Posts

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

Avatar
Yakiv

30 November 2009 at 11:50am Community Member, 59 Posts

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

Avatar
mschiefmaker

30 November 2009 at 10:48pm Community Member, 187 Posts

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

Avatar
Double-A-Ron

30 November 2009 at 11:12pm (Last edited: 30 November 2009 11:14pm), Community Member, 604 Posts

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

Avatar
mschiefmaker

1 December 2009 at 9:39pm Community Member, 187 Posts

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

Avatar
Double-A-Ron

2 December 2009 at 8:19am Community Member, 604 Posts

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

Go to Top