MrBaseball34 Posted June 29, 2010 Share Posted June 29, 2010 Is there a way to have shipping setup where we offer free shipping UP TO a certain weight?We'd like to offer free shipping over $100 BUT when shipping weight < 50lbs.We got hosed on a deal where we sold a product that cost $150 but weighed 120lbs and cost us$102 to ship.Our profit was $-75.00 Link to comment Share on other sites More sharing options...
rocky Posted June 30, 2010 Share Posted June 30, 2010 You could try changing line 833 of classes/Cart.php (in PrestaShop v1.3) from: if ($orderTotalwithDiscounts >= floatval($free_fees_price) AND floatval($free_fees_price) > 0) to: if ($orderTotalwithDiscounts >= floatval($free_fees_price) AND floatval($free_fees_price) > 0 AND $this->getTotalWeight() < 50) Link to comment Share on other sites More sharing options...
MrBaseball34 Posted June 30, 2010 Author Share Posted June 30, 2010 rocky,seems that the Cart class file is v1.2 even though the admin page says the install is v1.3.0.1. $configuration = Configuration::getMultiple(array('PS_SHIPPING_FREE_PRICE', 'PS_SHIPPING_HANDLING', 'PS_SHIPPING_METHOD', 'PS_SHIPPING_FREE_MAX_WEIGHT')); // Free fees if (isset($configuration['PS_SHIPPING_FREE_PRICE']) AND $orderTotal >= floatval($configuration['PS_SHIPPING_FREE_PRICE']) AND floatval($configuration['PS_SHIPPING_FREE_PRICE']) > 0) return $shipping_cost; /* if (isset($configuration['PS_SHIPPING_FREE_WEIGHT']) AND $this->getTotalWeight() >= floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) AND floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) > 0) return $shipping_cost; */ if (isset($configuration['PS_SHIPPING_FREE_MAX_WEIGHT']) AND $orderTotal <= floatval($configuration['PS_SHIPPING_FREE_MAX_WEIGHT'])) return $shipping_cost; I added the configuration PS_SHIPPING_FREE_MAX_WEIGHT, although I have yet to add it to the admin page, ;-)I was wondering if the code above would work and whether it should be setup as an if/elseif insteadAlso, isn't this kind of redundant in the first if statement? AND floatval($configuration['PS_SHIPPING_FREE_PRICE']) > 0) Because if $configuration['PS_SHIPPING_FREE_PRICE'] is not set, floatval($configuration['PS_SHIPPING_FREE_PRICE']) would return 0 Link to comment Share on other sites More sharing options...
rocky Posted July 1, 2010 Share Posted July 1, 2010 It is required, since entering "0" as the "Free shipping starts at" value disables free shipping. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted July 1, 2010 Author Share Posted July 1, 2010 did you see my other question? I was wondering if the code above would work and whether it should be setup as an if/elseif instead Link to comment Share on other sites More sharing options...
rocky Posted July 1, 2010 Share Posted July 1, 2010 It will work the same as two ifs or one if-else. Try the code and let me know if it works. Link to comment Share on other sites More sharing options...
javier_caballero Posted August 21, 2012 Share Posted August 21, 2012 It will work the same as two ifs or one if-else. Try the code and let me know if it works. Hello rocky. I test this in the 1.4.8.3 version, and not works...can you help me with it?? The Cart.php file is very different. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now