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
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
module_name: The field ...