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

Checking the currency

In PrestaShop, the merchant can enable different currencies for each module payment. Go to the Payment menu under Modules in your back office; you will see a section named CURRENCY RESTRICTIONS (you also have other sections such as COUNTRY RESTRICTIONS):

Checking the currency

The displayPayment hook won't display a payment method if the customer has chosen a currency that is not enabled for the payment method in question.

However, it's safer to add security in your payment module. In the initContent method of your module's Payment front controller, add the following lines just before assigning data to Smarty:

// Check if currency is accepted if (!$this->checkCurrency()) ...

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