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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

Cannot click on Change Country without checking T&Cs


Go to End


12 Posts   4718 Views

Avatar
Double-A-Ron

Community Member, 607 Posts

2 December 2009 at 8:38am

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

Avatar
imsas

Community Member, 22 Posts

19 March 2010 at 4:07am

Edited: 19/03/2010 4:08am

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();
	}

Avatar
merrick_sd

Community Member, 99 Posts

1 February 2011 at 2:18am

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

Avatar
merrick_sd

Community Member, 99 Posts

4 February 2011 at 4:43am

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?

Go to Top