The cloning the Flat Rate flat module would be the best choice and then customize when each of the modules show based on the content of the shopping cart ...
The cloning the Flat Rate flat module would be the best choice and then customize when each of the modules show based on the content of the shopping cart ...
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!
You can use the code in RED and adapt it as needed:
Code:// disable only when entire cart is free shipping if (zen_get_shipping_enabled($this->code)) { $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false); } // bof: only show for category 1, 4 and 5 $chk_cat = 0; $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','1'); $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','4'); $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','5'); if ($chk_cat != $_SESSION['cart']->show_total()) { $this->enabled = false; } // eof: only show for category 1, 4 and 5
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've managed to clone the shipping module and update them for Livestock & Drystock, but I can't work out the third one for "mixed" orders containing both.
Does it actually need it's own code adding, or not due to the other codes using single category ID's ( i.e, if two different ID's were used ( 2 & 6 ), would the standard flat rate shipping come into play?
Also, you need to add for the Admin an IF around the new code:
For checking it is a mixed cart try:Code:if (!IS_ADMIN_FLAG) { // new code here }
That echo can be uncommented for testing purposes ...Code:// bof: only show for mixed cart category 1, 4 and 5 & category 2 and 6 if (!IS_ADMIN_FLAG) { $chk_cat = 0; $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','1'); $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','4'); $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','5'); $chk_cat2 = 0; $chk_cat2 += $_SESSION['cart']->in_cart_check('master_categories_id','2'); $chk_cat2 += $_SESSION['cart']->in_cart_check('master_categories_id','6'); //echo 'Flat sees $chk_cat: ' . $chk_cat . ' $chk_cat2: ' . $chk_cat2 . '<br>'; if ($this->enabled && ($chk_cat > 0 && $chk_cat2 > 0)) { $this->enabled = true; } else { $this->enabled = false; } } // eof: only show for mixed cart category 1, 4 and 5 & category 2 and 6
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've implemented the above but it doesn't seem to work.
I've got the flat rate shippings to display, but the cheapest shipping option comes up bold on checkout and allows checkout regardless of category number.
I need it to automatically select shipping based on category ID or even automatically add the correct shipping to customer total at checkout?