Is this products_attributes_id 8 the only Attribute on this Product?
Is this products_attributes_id 8 the only Attribute on this 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!
No, it also has a products_attributes_id of '7'
No Frame - products_attributes_id 7 (options_values_id 2)
With Frame - products_attributes_id 8 (options_values_id 1)
Only some products have a frame option
It is products 'With Frame' that need to be classed as oversized
Would something like this work for you?
I have an idea to expand a similar function with more flexibility in the future but I am still giving it a think ...Code:/* Method to calculate the number of items in a cart based on an attribute option_id and option_values_id combo */ // example: $_SESSION['cart']->in_cart_check_attrib_quantity(1, 16) function in_cart_check_attrib_quantity($check_option_id, $check_option_values_id) { // global $db; // if nothing is in cart return 0 if (!is_array($this->contents)) return 0; // compute total quantity for field $in_cart_check_qty = 0; $chk_products = $this->get_products(); for ($i=0, $n=sizeof($chk_products); $i<$n; $i++) { foreach ($chk_products[$i]['attributes'] as $option => $value) { if ($option == $check_option_id && $value == $check_option_values_id) { // echo 'Attribute FOUND FOR $option: ' . $option . ' $value: ' . $value . ' quantity: ' . $chk_products[$i]['quantity'] . '<br><br>'; $in_cart_check_qty += $chk_products[$i]['quantity']; } } } return $in_cart_check_qty; }![]()
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!
I think that is exactly what I needed, the couple of checks I've made seem to work well - I'll test more once I've fully set up my shipping and hopefully give some feedback/suggestions for your future design.
This last bit of help was all I needed to finalise my shipping costs (until I find something else!) so thank you very much.
I've sent the Team a coffee and donut.
Cheers
Simon