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

Creating your own order state

You are probably asking yourself, why create your own order state when there are already order states we need in PrestaShop? Yes, you're right, but there will always be a moment when you need to create one for a specific need. And the most important of all, you can associate e-mail sending with order states.

We will start by coding a method named installOrderState in your mymodpayment module's main class. This method is very simple; we just have to instantiate an OrderState object model, fill it in, and call the add method.

Here are the different variables of an OrderState object model:

  • send_email: This is a flag that indicates whether an e-mail has to be sent (we will set it to false for now).
  • module_name: The field ...

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