
Originally Posted by
krhody
Y1- check cart for products in it - there has to be something there to check
1b-load products_id into array ? ? - maybe
2- check db - zen_products for products_weight - individual product weight not the whole cart.
2b- Use array for products_id (s) to check weight of
3- if products_weight is greater than 60 - since packed it couldn't go UPS or USPS
3b- load products that are over 60 lbs. into an array - NOT REQUIRED but could be useful for future expansion!? ?
4- $this_enabled = false; - turn off shipping module
That's essentially what Ajeh posted above.
1a, 1b:
Code:
$check_products = $_SESSION['cart']->get_products();
2a, 2b:
Code:
for ($i=0, $n=sizeof($check_products); $i<$n; $i++) {
echo 'I see ' . $check_products[$i]['id'] . ' Product weight ' . $check_products[$i]['weight'] . '<br>';
}
So, modifying it slightly to adapt to your needs, gives this:
Code:
$check_products = $_SESSION['cart']->get_products();
for ($i=0, $n=sizeof($check_products); $i<$n; $i++) {
if ($check_products[$i]['weight'] > 60 ) $this->enabled = false;
}