Forums / Built-in Shipping and Payment Modules / How to disable "Store pick up" option for products over certain weight?

How to disable "Store pick up" option for products over certain weight?

Started by misiu on 14 Mar 2012, 5:00 PM · Views: 1,131

Results 1 to 2 of 2
14 Mar 2012, 5:00 PM
#1
misiu avatar

misiu

New Zenner

Join Date:
Jan 2011
Posts:
2
Plugin Contributions:
0

How to disable "Store pick up" option for products over certain weight?

I use both store pickup and zone rates options. Zone shipping table is set by weight. Since products over 900Kg is not suitable for picking up by customer, I have to disable the store pick up option for these products at the check out but keep the delivery option. Can anybody please help?? Thank you in advance

15 Mar 2012, 4:02 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How to disable "Store pick up" option for products over certain weight?

You could customize the Store Pickup module with the code:

    $this->enabled = ((MODULE_SHIPPING_STOREPICKUP_STATUS == 'True') ? true : false);

// bof: turn off when weight of a product is >= 900
      if (!IS_ADMIN_FLAG) {
        global $cart;
        $products = $_SESSION['cart']->get_products();
//echo '<pre>'; echo var_dump($products); echo '</pre>' . '<br><br>';
        for ($i=0, $n=sizeof($products); $i<$n; $i++) {
//echo 'Products ID: ' . $products[$i]['id'] . ' name: ' . $products[$i]['name'] . ' weight: ' . $products[$i]['weight'] . '<br>';
          if ($products[$i]['weight'] >= 900) {
            $this->enabled = false;
            break;
          }
        }
      }
// eof: turn off when weight of a product is >= 900

    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_STOREPICKUP_ZONE > 0) ) {

This is assuming you just care about quantity 1 of a Product being >= 900 and not the weight of the cart or multiple quantities of a Product ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!