Eutanasio Posted August 8, 2021 Share Posted August 8, 2021 Hi, How can I do to stop Prestashop v1.7.x charging twice shipping costs when an order contains products from various warehouses? for those cases we just collect items in 1 warehouse before proceeding with a single shipping, so no need to scare customers with double shipping costs! Thanks Link to comment Share on other sites More sharing options...
Janett Posted August 9, 2021 Share Posted August 9, 2021 PrestaShop will create multiple package, each with a shipping cost : https://github.com/PrestaShop/PrestaShop/blob/1.7.7.x/classes/Cart.php#L2519 If you want customer paid only shipping cost for the first package, your carrier module should implement fonction getPackageShippingCost() in order to set shipping cost to zero for others packages. See https://github.com/PrestaShop/PrestaShop/blob/1.7.7.x/classes/Cart.php#L3878 Link to comment Share on other sites More sharing options...
Eutanasio Posted August 9, 2021 Author Share Posted August 9, 2021 1 hour ago, Janett said: PrestaShop will create multiple package, each with a shipping cost : https://github.com/PrestaShop/PrestaShop/blob/1.7.7.x/classes/Cart.php#L2519 If you want customer paid only shipping cost for the first package, your carrier module should implement fonction getPackageShippingCost() in order to set shipping cost to zero for others packages. See https://github.com/PrestaShop/PrestaShop/blob/1.7.7.x/classes/Cart.php#L3878 Thanks for the answer! I don't use any modules for carriers, just use the native Prestashop carriers system, so nothing I can configure from that side. How would you suggest I can do it in my case? Thanks Link to comment Share on other sites More sharing options...
Janett Posted August 10, 2021 Share Posted August 10, 2021 You should create your own carrier module and implement getPackageShippingCost() with logic to return free shipping after the first package. A carrier module is not hard to do, you can find an example here : https://github.com/Xaconi/prestashopcarriertester This example needs some changes to implement getPackageShippingCost() and recommendations of https://devdocs.prestashop.com/1.7/modules/carrier/ Link to comment Share on other sites More sharing options...
Eutanasio Posted November 8, 2023 Author Share Posted November 8, 2023 here's the solution: 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