Restrict Payment Options for International Customers

General ShopSite user discussion

Restrict Payment Options for International Customers

Postby rbuening28 » Wed Jun 10, 2009 5:26 pm

I am wanting to restrict International customers from using PayPal as the only form of payment. Can be done using the JavaScript Check-It function in ShopSite? I have come across this code in the examples provided:

Code: Select all
if (document.order.shipping[0].type == "radio") {
  for (var i=0; i < document.order.shipping.length; i++)
  {
     if (document.order.shipping[i].checked)
     {
     var rad_val = document.order.shipping[i].value;
     }
  }
}
else {
  var rad_val = document.order.shipping.value;
}

if (button == "8" && document.order.country.value != "US" && (rad_val == "XX" || rad_val == "YYY")) {                                     
  alert("International customers cannot choose USA ONLY shipping options");
         return(false);
}


and...

Code: Select all
var shippingaddress="";
var billingaddress="";
billingaddress = document.billing.Address.value;
shippingaddress = document.billing.ShipAddress.value;
if (shippingaddress.match(/PO Box/i)) {
  error += "We cannot ship to a PO Box\n";
}
if (shippingaddress.match(/P.O. Box/i)) {
  error += "We cannot ship to a PO Box\n";
}
if ((document.billing.usebilling != undefined) &&
        (document.billing.usebilling.checked == true)) {
if (billingaddress.match(/PO Box/i)) {
  error += "We cannot ship to a PO Box\n";
}
if (billingaddress.match(/P.O. Box/i)) {
  error += "We cannot ship to a PO Box\n";
}
}


Is there a way these can be combined in a check-it JavaScript function for limiting the International customers to PayPal only? Has anyone come across this type of issue before?

Thanks in advance for any help.
rbuening28
 
Posts: 6
Joined: Sun Nov 09, 2008 4:43 pm

Postby rbuening28 » Wed Oct 21, 2009 12:47 pm

Just seeing if anyone else has come across this or knows of any information that may be useful. Thanks.
rbuening28
 
Posts: 6
Joined: Sun Nov 09, 2008 4:43 pm


Return to User Forum

Who is online

Users browsing this forum: No registered users and 140 guests