cernicektomas Posted September 10, 2016 Share Posted September 10, 2016 Hi please, I am using PrestaShop 1.6.1.5 and I need little help with some changes in Carriers. There is value MAXIMUM weight of delivery for each Carrier. I need to change this to MINIMUM weight of delivery. It means that this carrier would be available only for orders with weight higher than XY. Could you please someone tell me if this change is possible and how difficult it would be? Thanks in advance, Regards, Tomas Link to comment Share on other sites More sharing options...
rocky Posted September 12, 2016 Share Posted September 12, 2016 It seems there's only one place that variable is used, so I should be easy to change. It's the following code on line 1413 of classes/Carrier.php: if ($carrier->max_weight > 0 && ($carrier->max_weight < $product->weight * $cart_quantity || $carrier->max_weight < $cart_weight)) { You can try changing it to: if ($carrier->max_weight > 0 && ($carrier->max_weight > $product->weight * $cart_quantity || $carrier->max_weight > $cart_weight)) { It's better to do this using an override so PrestaShop won't overwrite your code during an upgrade. Create override/classes/Carrier.php like this: <?php class Carrier extends CarrierCore { // Paste your getAvailableCarrierList function here with the changed line } Remember to go to the Advanced Parameters > Performance tab and click the "Clear cache" button (or manually delete cache/class_index.php) so PrestaShop can find the override. Link to comment Share on other sites More sharing options...
cernicektomas Posted September 12, 2016 Author Share Posted September 12, 2016 Thank you very much. It works perfect. 1 Link to comment Share on other sites More sharing options...
Boonyawat Posted November 8, 2016 Share Posted November 8, 2016 This is awesome!!! I have been looking for this for quite a while. I have a question. In my scenario, I need to set a Minimal order amount for a carrier. For instance, I have one specific carrier acts as a dedicated carrier with subsidized charge. I would like to activate this carrier when and only when an order amount is above a certain value. The idea is that I want to subsidize a shipping charge of faster carrier for a customer who buy more. Thank you very much, Boon Link to comment Share on other sites More sharing options...
MARK-APP.com Posted August 4, 2017 Share Posted August 4, 2017 Maybe this module also is also a good solution for you? https://addons.prestashop.com/en/order-management/26164-minimum-order-weight.html 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