If you want $14.95 per Rake, then install the Item Rate item and customize the code:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
}
// bof: only show for Rakes
if (!IS_ADMIN_FLAG) {
global $cart;
$chk_rakes = $_SESSION['cart']->in_cart_check('products_id', '27');
if ($chk_rakes != $_SESSION['cart']->count_contents()) {
// turn off
$this->enabled = false;
}
}
// eof: only show for Rakes
if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_ITEM_ZONE > 0) ) {
And set the Item Rate to 14.95 ...
This will only show when only Rakes are in the Cart ...
At the Top of the UPS shipping module, add this code so that it will not show when only Rakes are in the Cart ...
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_UPS_STATUS == 'True') ? true : false);
}
// bof: do NOT if ONLY show for Rakes
if (!IS_ADMIN_FLAG) {
global $cart;
$chk_rakes = $_SESSION['cart']->in_cart_check('products_id', '27');
if ($chk_rakes == $_SESSION['cart']->count_contents()) {
// turn off
$this->enabled = false;
}
}
// eof: do NOT if ONLY show for Rakes
if ($this->enabled) {
In the function quote, you should have:
$cost = preg_replace('/[^0-9.]/', '', $cost);
// bof: add Rake charge
$chk_rakes = 0;
$chk_rakes = $_SESSION['cart']->in_cart_check('products_id', '27');
$chk_rakes = $chk_rakes * 14.95;
$methods[] = array('id' => $type,
'title' => $this->types[$type],
'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_UPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_UPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_UPS_HANDLING) + $chk_rakes );
}
$this->quotes['methods'] = $methods;
Now, if Rakes are only in the Cart the Item Rate will show ...
If this is a mixed cart, then $14.95 per Rake will be added to the Calculated UPS charges for the other Products ...
Make sure that Rakes products_id 27 has a 0 weight ...
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!