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 the payment controller

We will now create a front controller named Payment. But first of all, in displayPayment.tpl, set the link to the controller on the href attribute using the getModuleLink method (which we also saw in the previous chapter):

<a href="{$link->getModuleLink('mymodpayment',
'payment')|escape:'html'}" class="mymodpayment">

Next, create the payment.php file in the controllers/front/ directory of your module and fill it with a front controller that will display the payment.tpl template:

<?php class MyModPaymentPaymentModuleFrontController extends ModuleFrontController { public $ssl = true; public function initContent() { // Call parent init content method parent::initContent(); // Set template $this->setTemplate('payment.tpl'); ...

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