Jump to content

Custom module for Address class customization


Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...