I am running Zen Cart 1.3.9h with PHP Version 5.2.6
We currently have shipping set as £5.95 on all UK orders under £75 and free over £75, £20 for Europe and £40 for the rest of the world. But we carry some items such as medical fridges that are costly to ship and we need to charge an extra handling fee (£15) for these items we need some code that will allow us to add extra shipping costs of theses items. I was thinking there may be some way of setting an a rule if item XYZ then add £15 to shipping, I don't know if this is possible but it would be amazing if it was.
I have been reading Zen Cart forums and yet to find a solution that will do this for free I found one paid module that might do it (http://ceon.net/software/business/ze...vanced-shipper).
The closest code I found for doing this was in a post about using the Free Shipping Options module that would seem easy enough to use but only allows one shipping zone so I need it to work on the php script I have attached this is the code that I found written by Ajeh on these forums;
// bof: check for oversized items and charge £15.00 extra per item
global $cart;
$chk_oversized = 0;
$oversized_title = '';
$chk_oversized += $_SESSION['cart']->in_cart_check('products_id', '1053');
$chk_oversized += $_SESSION['cart']->in_cart_check('products_id', '1046');
$chk_oversized += $_SESSION['cart']->in_cart_check('products_id', '3242');
$extra_shipping = $chk_oversized * 15.00;
if ($extra_shipping > 0) {
$oversized_title = '+ overweight shipping surcharge';
}
if ($this->enabled) {
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_FREEOPTIONS_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => MODULE_SHIPPING_FREEOPTIONS_TEXT_WAY . $oversized_title,
'cost' => MODULE_SHIPPING_FREEOPTIONS_COST + MODULE_SHIPPING_FREEOPTIONS_HANDLING + $extra_shipping)));
// eof: check for oversized items and charge £15.00 extra per item
Would I be able to use this code with the Zones Module? If not can someone suggest a code that will work. Or another module that would let me set an extra cost on the oversized items and still let us offer free shipping on other orders over £75 in the UK and the extra costs for international shipping.
Thank you so much.


Reply With Quote
