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

Validating a cart into an order

We will now create a module's front controller named validation (you should have created the form, whose action calls the validation controller, in the previous section of this chapter).

This controller won't display anything; it will only transform a cart into an order. First, create a file named validation.php in the controllers/front/ directory of your module, then create the corresponding class in it:

<?php
class MyModPaymentValidationModuleFrontController extends ModuleFrontController
{
}

We will create a method called postProcess (in fact, we will override it since it already exists in all the controllers). This method is called at the beginning of the controller's execution, so we will be able to perform all ...

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