firescorpz Posted March 27, 2010 Share Posted March 27, 2010 Hi,I want to make my delivery to customer this wayTwo mode for delivery method to customer1) customer can select courier service to ship the item to them2) If customer order above $100, free deliver.As customer check out, they are able to select between the 2 option.However as I do a testing, if found out that even when when customerorder is less than $100, the option No. 2 if thereIs there any settling that I must do in order that if the customer order is below $100, the option no.2 don't appear?Please advise me thank you Link to comment Share on other sites More sharing options...
rocky Posted March 27, 2010 Share Posted March 27, 2010 I think you should be able to create a price range on carrier no 2 of $100-$1000000, then edit the carrier and change "Out-of-range behavior" to "Disable carrier". That should hide the carrier unless the total order is between $100 and $1000000. Link to comment Share on other sites More sharing options...
firescorpz Posted March 27, 2010 Author Share Posted March 27, 2010 Hi thank you, I will try that and see if it works Link to comment Share on other sites More sharing options...
firescorpz Posted March 27, 2010 Author Share Posted March 27, 2010 hi rocky,it does not work i do not know whether i did the right thingdo youo have more details step by step instruction? Link to comment Share on other sites More sharing options...
firescorpz Posted March 28, 2010 Author Share Posted March 28, 2010 Hi anyone can advise? Link to comment Share on other sites More sharing options...
rocky Posted March 29, 2010 Share Posted March 29, 2010 Turns out there is a bug in the out-of-range behavior that was fixed in v1.3. You need to modify classes/Carrier.php and change the checkDeliveryPriceByPrice function on line 193 from: static public function checkDeliveryPriceByPrice($id_carrier, $orderTotal, $id_zone) { $result = Db::getInstance()->getRow(' SELECT d.`price` FROM `'._DB_PREFIX_.'delivery` d LEFT JOIN `'._DB_PREFIX_.'range_price` r ON d.`id_range_price` = r.`id_range_price` WHERE d.`id_zone` = '.intval($id_zone).' AND '.floatval($orderTotal).' <= r.`delimiter2` AND d.`id_carrier` = '.intval($id_carrier).' ORDER BY r.`delimiter1` ASC'); if (!isset($result['price'])) return false; return true; } to: static public function checkDeliveryPriceByPrice($id_carrier, $orderTotal, $id_zone) { $result = Db::getInstance()->getRow(' SELECT d.`price` FROM `'._DB_PREFIX_.'delivery` d LEFT JOIN `'._DB_PREFIX_.'range_price` r ON d.`id_range_price` = r.`id_range_price` WHERE d.`id_zone` = '.intval($id_zone).' AND '.floatval($orderTotal).' >= r.`delimiter1` AND '.floatval($orderTotal).' < r.`delimiter2` AND d.`id_carrier` = '.intval($id_carrier).' ORDER BY r.`delimiter1` ASC'); if (!isset($result['price'])) return false; return true; } Although it doesn't affect you since you are using price-based shipping, you should also change the checkDeliveryPriceByWeight function on line 136 of classes/Carrier.php from: static public function checkDeliveryPriceByWeight($id_carrier, $totalWeight, $id_zone) { $result = Db::getInstance()->getRow(' SELECT d.`price` FROM `'._DB_PREFIX_.'delivery` d LEFT JOIN `'._DB_PREFIX_.'range_weight` w ON d.`id_range_weight` = w.`id_range_weight` WHERE d.`id_zone` = '.intval($id_zone).' AND '.floatval($totalWeight).' <= w.`delimiter2` AND d.`id_carrier` = '.intval($id_carrier).' ORDER BY w.`delimiter1` ASC'); if (!isset($result['price'])) return false; return true; } to: static public function checkDeliveryPriceByWeight($id_carrier, $totalWeight, $id_zone) { $result = Db::getInstance()->getRow(' SELECT d.`price` FROM `'._DB_PREFIX_.'delivery` d LEFT JOIN `'._DB_PREFIX_.'range_weight` w ON d.`id_range_weight` = w.`id_range_weight` WHERE d.`id_zone` = '.intval($id_zone).' AND '.floatval($totalWeight).' >= w.`delimiter1` AND '.floatval($totalWeight).' < w.`delimiter2` AND d.`id_carrier` = '.intval($id_carrier).' ORDER BY w.`delimiter1` ASC'); if (!isset($result['price'])) return false; return true; } Link to comment Share on other sites More sharing options...
roastchicken Posted March 29, 2010 Share Posted March 29, 2010 HiI've had a similiar problem and running v 1.2.5 :I have 2 carriers, Royal mail and Parcelforce with differing weight capacities1. royal mail (0 – 2kg) at £2.002. royal mail (2 – 4kg) at £2.503. Parcelforce (0-10000kg) at £10When the overall weight exceeds 4kg, I would expect the Cart to drop into option 3 (Parcelforce) but it remains with Royal mail ( £2.50) ? I then set the ‘Out of range behaviour’ to disable but now when I exceed 4kg, delivery goes to £0. So the cart on the home page does not show correct total.But when I then goto the checkout, the cart then re-adjusts for Parcelforce and now shows the correct amount.All carriers are are shipping to the UK from the UK i.e. in the europe zone.I've just tried the fix to the classes (checkDeliveryPriceByPrice function, checkDeliveryPriceByWeight function) BUT im still getting the above problem !Has anyone got it to work ?? Link to comment Share on other sites More sharing options...
firescorpz Posted April 12, 2010 Author Share Posted April 12, 2010 Beside doing it by using the source code, is there any other way to do it? Link to comment Share on other sites More sharing options...
fatkul Posted August 4, 2010 Share Posted August 4, 2010 Turns out there is a bug in the out-of-range behavior that was fixed in v1.3. You need to modify classes/Carrier.php and change the checkDeliveryPriceByPrice function on line 193 from: static public function checkDeliveryPriceByPrice($id_carrier, $orderTotal, $id_zone) { $result = Db::getInstance()->getRow(' SELECT d.`price` FROM `'._DB_PREFIX_.'delivery` d LEFT JOIN `'._DB_PREFIX_.'range_price` r ON d.`id_range_price` = r.`id_range_price` WHERE d.`id_zone` = '.intval($id_zone).' AND '.floatval($orderTotal).' <= r.`delimiter2` AND d.`id_carrier` = '.intval($id_carrier).' ORDER BY r.`delimiter1` ASC'); if (!isset($result['price'])) return false; return true; } to: static public function checkDeliveryPriceByPrice($id_carrier, $orderTotal, $id_zone) { $result = Db::getInstance()->getRow(' SELECT d.`price` FROM `'._DB_PREFIX_.'delivery` d LEFT JOIN `'._DB_PREFIX_.'range_price` r ON d.`id_range_price` = r.`id_range_price` WHERE d.`id_zone` = '.intval($id_zone).' AND '.floatval($orderTotal).' >= r.`delimiter1` AND '.floatval($orderTotal).' < r.`delimiter2` AND d.`id_carrier` = '.intval($id_carrier).' ORDER BY r.`delimiter1` ASC'); if (!isset($result['price'])) return false; return true; } Although it doesn't affect you since you are using price-based shipping, you should also change the checkDeliveryPriceByWeight function on line 136 of classes/Carrier.php from: static public function checkDeliveryPriceByWeight($id_carrier, $totalWeight, $id_zone) { $result = Db::getInstance()->getRow(' SELECT d.`price` FROM `'._DB_PREFIX_.'delivery` d LEFT JOIN `'._DB_PREFIX_.'range_weight` w ON d.`id_range_weight` = w.`id_range_weight` WHERE d.`id_zone` = '.intval($id_zone).' AND '.floatval($totalWeight).' <= w.`delimiter2` AND d.`id_carrier` = '.intval($id_carrier).' ORDER BY w.`delimiter1` ASC'); if (!isset($result['price'])) return false; return true; } to: static public function checkDeliveryPriceByWeight($id_carrier, $totalWeight, $id_zone) { $result = Db::getInstance()->getRow(' SELECT d.`price` FROM `'._DB_PREFIX_.'delivery` d LEFT JOIN `'._DB_PREFIX_.'range_weight` w ON d.`id_range_weight` = w.`id_range_weight` WHERE d.`id_zone` = '.intval($id_zone).' AND '.floatval($totalWeight).' >= w.`delimiter1` AND '.floatval($totalWeight).' < w.`delimiter2` AND d.`id_carrier` = '.intval($id_carrier).' ORDER BY w.`delimiter1` ASC'); if (!isset($result['price'])) return false; return true; } thank you for your fix.do we need to change other related functions ?;- getDeliveryPriceByPrice- getDeliveryPriceByWeightregards, Link to comment Share on other sites More sharing options...
rocky Posted August 4, 2010 Share Posted August 4, 2010 No, you don't. Link to comment Share on other sites More sharing options...
holle75 Posted April 29, 2011 Share Posted April 29, 2011 @roastchickensame problem here using (still) 1.2.5.0. The cart is not responding according to the changes. i don´t even get a "0" for delivery, the whole line is gone then. Did you find a solution? (did already the changes suggested by Rocky)bestH Link to comment Share on other sites More sharing options...
holle75 Posted April 29, 2011 Share Posted April 29, 2011 Well, deleted all Carriers and installed them again. Problem solved .... magic :ohh: Link to comment Share on other sites More sharing options...
Recommended Posts