O'Reilly logo

PrestaShop Module Development by Fabien Serny

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Handling carrier update

If you have played a bit with the carrier system in the PrestaShop administration panel, you might have noticed that when you update a carrier, the carrier ID changes. In fact, when you update a carrier, PrestaShop will create a new carrier by copying the one you want to update and applying your changes. It will then delete (set the flag deleted to 1) the old carrier.

So if we think about it and if a merchant updates a carrier attached to our module, the carrier ID saved in the configuration table won't match anymore. Do not worry, we can handle this very simply.

First, we will hook our module on the actionCarrierUpdate hook, which, as the name indicates, is called when a carrier is updated. So, add the following code in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required