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
Re: How to disable "Store pick up" option for products over certain weight?
You could customize the Store Pickup module with the code:
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 ...