What's New
Tagged: carrier, country, easycheckout
- AuthorPosts
Then you have to set those dropdowns to empty be default. Take these two steps:
1. Add this code to the \modules\steasycheckout\views\js\front.js file, see attached pic.var bs = $('#steco_customer_form_register .st_form_item_birthday select'); if(bs.length){ bs.each(function(){ if(!$(this).val()){ validate = false; return false; } }); $('#steco_customer_form_register .st_form_item_birthday').toggleClass('st-has-error', !validate); if(!validate){ return validate; } }
2. Replace this code in the \modules\steasycheckout\views\templates\hook\_partials\form-fields.tpl file
time={$field.value}
Withtime=null all_empty=''
The code added to the \modules\steasycheckout\views\js\front.js file will be included in the next update.
Attachments:
Hi,
just downloaded your latest v2.6.8. There is still the same issues I’m afraid.
1/ DOB selected drop-dow menu and I can easily checkout without touching/changing it – it will therefore display today’s date – it is on my test server, please feel free to try, I tried several times. I have not changed any files, apart from the length required for the phone number in front.js file toreturn /^[\(\)\s\-\+\d\.x\#]{9,20}$/.test(val);
I’ve included the change to the \modules\steasycheckout\views\js\front.js file in v2.6.8.
The change to the \modules\steasycheckout\views\templates\hook\_partials\form-fields.tpl is not included, because currently you are the only one who needs the feature. I will add an option in the next update to save you the trouble of editing the form-fields.tpl file.
Add this code to the verify_register function in the \modules\steasycheckout\views\js\front.js file, put it right above this line “return validate;”
var bd = new Date($('#steco_customer_form_register .st_form_item_birthday select[name="stbirthday[Year]"]').val()+'-'+$('#steco_customer_form_register .st_form_item_birthday select[name="stbirthday[Month]"]').val()+'-'+$('#steco_customer_form_register .st_form_item_birthday select[name="stbirthday[Day]"]').val()) var today = new Date().setHours(0, 0, 0, 0); if(bd.getTime()>=today){ $('#steco_customer_form_register .st_form_item_birthday').toggleClass('st-has-error', true); return false; }
If you need to add an 18 years old restriction, then use this code instead.
var bd = new Date($('#steco_customer_form_register .st_form_item_birthday select[name="stbirthday[Year]"]').val()+'-'+$('#steco_customer_form_register .st_form_item_birthday select[name="stbirthday[Month]"]').val()+'-'+$('#steco_customer_form_register .st_form_item_birthday select[name="stbirthday[Day]"]').val()) var today = new Date(); if(bd.getTime()>=new Date(today.getFullYear()-18, today.getMonth(), today.getDate(), 0, 0, 0)){ $('#steco_customer_form_register .st_form_item_birthday').toggleClass('st-has-error', true); return false; }
Don’t worry about time differences, js codes run on client-side.
Hi,
1/ great, it works as expected, much more logical for customers. Is it possible to also complete DOB and social title (if completed)?
2/ is it possible to change the verify function on the checkout form – phone number so it works the same way as in this video? On the password section, it will give you a hint of min characters required and the red box will disappear as soon as you type 5 characters. It is logical and not confusing.
On the checkout form, the red box will disappear as soon as you start typing first number, then you click the payment option and it will tell you “This field is invalid” – people do not know why. So, is it possible to
a/ keep the red box until required characters are reached (9 in my case)
b/ give a better hint that 9 numbers are required
That way it will be much better- AuthorPosts
You must be logged in to reply to this topic.