Detect Shipping Option on Checkout Screen

General ShopSite user discussion

Detect Shipping Option on Checkout Screen

Postby scottpon » Wed Oct 23, 2019 12:21 pm

in our Shopping cart screen, we have a shipping option for "Prepaid". then on the Checkout Screen we ask for prepaid information ( Account Number, Carrier, and Service ). However customers are filling out the prepaid information incorrectly. These 3 fields are custom fields Field02, Field03, and Field04, respectively.

Is there a way for the Checkout screen to detect what shipping option was selected?

If the system knows Prepaid was selected, we need to flag "enter prepaid info"?
and vice versa, (customer choose something other than "prepaid"). how do prevent entry to the prepaid section?
I assume Javascript, but I'm to familiar with Javascript. if someone could point me into a direction (java script with Shopsite) that'd be great.

Thanks.
scottpon
 
Posts: 5
Joined: Tue Oct 19, 2010 5:45 pm

Re: Detect Shipping Option on Checkout Screen

Postby ShopSite David » Fri Oct 25, 2019 10:33 am

One of our Engineers said that this code might work:

if(ss_shipping=='m5'){
if(ss_jQuery(document.billing.field02).val().replace(/^\s*|\s*$/,'')==''){dis_red('field02');error+='Please fill in a correct Account Number\n';}
if(ss_jQuery(document.billing.field03).val()=='N/A'){dis_red('field03');error+='Please select a Carrier\n';}
if(ss_jQuery(document.billing.field04).val().replace(/^\s*|\s*$/,'')==''){dis_red('field04');error+='Please fill in a Service\n';}
}


Add it in Commerce Setup > Order System > Shipping/Billing to the "Javascript added at start of
built-in CheckIt function:"
-David H.
ShopSite, Inc.
http://www.shopsite.com
ShopSite David
Site Admin
 
Posts: 312
Joined: Fri Aug 04, 2006 1:30 pm
Location: Utah

Re: Detect Shipping Option on Checkout Screen

Postby scottpon » Fri Oct 25, 2019 10:57 am

I don't have "Commerce Setup > Order System > Shipping/Billing "

I do have Commerce Setup > Order System
under Order system I have options for :layout info, shopping cart, checkout, confirmation, thank you, e-mail, abandon cart

Do you mean "Checkout"?
scottpon
 
Posts: 5
Joined: Tue Oct 19, 2010 5:45 pm

Re: Detect Shipping Option on Checkout Screen

Postby scottpon » Fri Oct 25, 2019 11:18 am

n/m it is on Checkout. Just discovered it. Thanks for your help.
scottpon
 
Posts: 5
Joined: Tue Oct 19, 2010 5:45 pm

Re: Detect Shipping Option on Checkout Screen

Postby scottpon » Fri Oct 25, 2019 3:06 pm

Does "m5" represent the 6th option (m0,m1,m2,m3,m4,m5)? we are going to change this list. Prepaid should be the last option. so if there is a 7th option (m6), and 8th (m7) option, I would change it to m7?
scottpon
 
Posts: 5
Joined: Tue Oct 19, 2010 5:45 pm

Re: Detect Shipping Option on Checkout Screen

Postby ShopSite David » Mon Oct 28, 2019 11:38 am

Engineering writes:

Yes, m5 represents the option they named "Prepaid." If they change the option then they will need to change the value they're looking for. The values for the shipping is the same as the name for the checkbox in the shipping config. The one that is originally labeled "Shipping 5" is m5. The first three all have names (reg, sec, and nex) then it starts at m3 and goes to m9.
-David H.
ShopSite, Inc.
http://www.shopsite.com
ShopSite David
Site Admin
 
Posts: 312
Joined: Fri Aug 04, 2006 1:30 pm
Location: Utah


Return to User Forum

Who is online

Users browsing this forum: No registered users and 41 guests

cron