Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

I'm building a site for a new client who is selling some items that can't be shipped to certain locales within the US.

I started by modifying the Restrict Delivery mod, where certain items are marked as "export controlled" and of course, I need finer control than just restricting which countries I can and can't ship to. I have 5 different categories that can be marked as "restricted" (and thus far, everything is working correctly) Where I get stuck is at the shopping_cart page;

In the original restrict delivery mod, the code for "checking" for export controlled items is:

if ($order->delivery['country_id'] != STORE_COUNTRY) {


$any_export_controlled=0;
   $productsex = $cart->get_products();

   for ($i=0, $n=sizeof($productsex); $i<$n; $i++) {
       $export = tep_check_export($productsex[$i]['id']);
       if (tep_not_null($export)) {

         $any_export_controlled = 1;
       }
}

 

I know I'll need to modify that to reflect something like the following, but don't know what syntax to use:

if ($order->delivery['zone_id'] = list of states or zones I can't ship to) {


$any_export_controlled=0;
   $productsex = $cart->get_products();

   for ($i=0, $n=sizeof($productsex); $i<$n; $i++) {
       $export = tep_check_export($productsex[$i]['id']);
       if (tep_not_null($export)) {

         $any_export_controlled = 1;
       }
}

 

Have I got at least the right idea here?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...