Search code examples
prestashopsmartyprestashop-1.7

{convertPrice price=$product.price} does not work in prestashop 1.7


This is the error:

Syntax error in template "file: / home / quetupec / public_html / clonpresta / modules / loyalty / views / templates / hook / shopping-cart .tpl "on line 32" {ls = 'that can be converted to a voucher of' mod = 'loyalty'} {convertPrice price = $ voucher} {if isset ($ guest_checkout) && $ guest_checkout} * {/ if}.
"unknown tag 'convertPrice'

I have tried the other one like Tools::displayPrice, but I think it is deprecated in 1.7.6.

Has anyone worked around on this?


Solution

  • In Prestashop 1.7* you don't need to use any smarty or php functions. All necessary data are already transferred to templates within arrays with products information. So just use $product.price and you will get already converted string. Also, be aware, that PS 1.6* and PS 1.7* templates and some modules aren't compatible in a storefront.