Jump to content

Template error


vtlor

Recommended Posts

Hello.

Some time ago, I have created a new plugin for a new method of payment.

In the last version of Prestashop (version 1.7.6.1) this plugin works very well. But not in Prestashop version 1.7.5.2.

To better explain.

This plugin check if the amount of the current payment in the cart is over the maximum amount of payment specificied in the plugin's config page. And if the amount in the cart is higher, the plugin redirect me to the failed order page in which a phrase alert me on this.

In this phrase, I have a dynamic string that should be replace with the formatted maximum amount of payment specificied in the plugin's config page.

The problem is that the dynamic string that should be replace with the formatted maximum amount of payment specificied in the plugin's config page is not replace as expected. This happens with the italian phrase but not with the phrase in english (in which the dynamic string is replaced instead).

Why I have this issue?
How can I resolve it?

Some useful information.

The two version of Prestashop (1.7.6.1 and 1.7.5.2) currently runs on the same server.
The server is a Linux 64bit.
In this server there are Apache 2 and PHP 7.3.
Prestashop 1.7.5.2 initially contained only the italian language (as the installation process). After, I have add a second language (english).

Thanks at all.

Edited by vtlor (see edit history)
Link to comment
Share on other sites

Hi.

About my error with Prestashop 1.7.5.2, I have an update.

The problem was related on Smarty template and the syntax used for the string substitution.

Before my update, in the template I had this type of instruction to substitute something in a string.

{l s='Reason: Sorry, the maximum allowed order total is [max_payments] to use this payment method.' sprintf=['[max_payments]' => {$inlire_max_pay_amount_formatted|escape:'htmlall'}] mod='inlire'}

And this instruction was working well in the last version of Prestashop.

However, with Prestashop 1.7.5.2 I had to change this instruction with the other below.

{l s='Reason: Sorry, the maximum allowed order total is %s to use this payment method.' sprintf=[{$inlire_max_pay_amount_formatted|escape:'htmlall'}] mod='inlire'}

Why the first instruction is not working in Prestashop 1.7.5.2?

Thanks again.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...