androbey Posted February 14, 2020 Share Posted February 14, 2020 Hi there, I am totally new to PrestaShop. And I hope this is the right place for my question. I once installed PrestaShop version 1.7.5.x and recently re-installed it with the latest stable version. My problem is: I have a specific requirement to calculate shipping cost based on zip code and custom zones. For this to work I made a change to `getZoneById` function in the Address class and copied it to overwrite folder. This worked fine for version 1.7.5.x but is no longer working in current version of PrestaShop. I found that the overwrite method is deprecated. So my question now is: What is the best way to accomplish this without making direct changes to core class files? Hope someone can help me. Best regards, Andreas Link to comment Share on other sites More sharing options...
fbenoist.com Posted February 15, 2020 Share Posted February 15, 2020 (edited) Hi, It is not a good practice to modify the PrestaShop code. To change the method for calculating shipping costs, you must create a carrier module. Edited February 15, 2020 by fbenoist.com (see edit history) Link to comment Share on other sites More sharing options...
androbey Posted February 15, 2020 Author Share Posted February 15, 2020 Hi @fbenoist.com, that's true, that was the reason for my request. I know created a simple module which uses the "actionGetIDZoneByAddressID" hook. It works fine, but zip codes and zone ids are hardcoded. It works but is not the best solution. I'm wondering if it is possible to make a configuration page which let's you select available zone ids? 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