Detect Shipping Option on Checkout Screen

General ShopSite user discussion
Post Reply
scottpon
Posts: 5
Joined: Tue Oct 19, 2010 5:45 pm

Detect Shipping Option on Checkout Screen

Post by scottpon »

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.
ShopSite David
Site Admin
Posts: 318
Joined: Fri Aug 04, 2006 1:30 pm
Location: Utah
Contact:

Re: Detect Shipping Option on Checkout Screen

Post by ShopSite David »

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
scottpon
Posts: 5
Joined: Tue Oct 19, 2010 5:45 pm

Re: Detect Shipping Option on Checkout Screen

Post by scottpon »

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

Post by scottpon »

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

Post by scottpon »

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?
ShopSite David
Site Admin
Posts: 318
Joined: Fri Aug 04, 2006 1:30 pm
Location: Utah
Contact:

Re: Detect Shipping Option on Checkout Screen

Post by ShopSite David »

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
Post Reply