JA MODULES Posted September 7, 2016 Share Posted September 7, 2016 Hello,In PrestaShop 1.7 this smarty code not work:{convertPrice price=$product.price}Appears this message:unknown tag "convertPrice"How use "convertPrice" in template for PrestaShop 1.7?Regards Link to comment Share on other sites More sharing options...
rebeca_lala Posted February 26, 2017 Share Posted February 26, 2017 Hi, in my case i have changed to {$product->convertPrice($product.price)} i hope that work for you Link to comment Share on other sites More sharing options...
Arnaud Drieux Posted March 6, 2017 Share Posted March 6, 2017 (edited) Hello. For all others prices you can use : {Tools::displayPrice($yourprice)}I haven't found an easiest way. Edited March 6, 2017 by arnaud1900 (see edit history) 4 1 Link to comment Share on other sites More sharing options...
Arnaud Drieux Posted July 13, 2019 Share Posted July 13, 2019 Hi everyone. Just a little clarification. Be careful !! I don't know if it's affect templates script but Tools::displayPrice is now deprecated with 1.7.6 Link to comment Share on other sites More sharing options...
Que Tupe Posted July 16, 2019 Share Posted July 16, 2019 Hello! I updated the store from 1.6.1.24 to the latest version 1.7.6 and I get the following 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} <sup> * </ sup> {/ if}. <br /> "unknown tag 'convertPrice' I have correctly selected my currency and location of the store. Link to comment Share on other sites More sharing options...
Arnaud Drieux Posted July 16, 2019 Share Posted July 16, 2019 Il y a 9 heures, Que Tupe a dit : Hello! I updated the store from 1.6.1.24 to the latest version 1.7.6 and I get the following 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} <sup> * </ sup> {/ if}. <br /> "unknown tag 'convertPrice' I have correctly selected my currency and location of the store. This due to you module. It seems it's not compatible 1.7.x Il y a 6 heures, shoptechmedia a dit : I am looking to see the correct answer to I am looking to see the correct answer to this, as I have the same issue with 1.7.x .. no problem of course with 1.6.. After take a look to new prestashop template 1.7 (templates/catalog/_partials/product-prices), it seems they do not use convertPrice anymore. In website root /src/Adapter/Presenter/Product/ProductlazyArray you can find $this->priceFormatter->format(xx) Maybe it's the best way to do. Link to comment Share on other sites More sharing options...
mikhsanh Posted January 15, 2020 Share Posted January 15, 2020 On 7/16/2019 at 6:37 PM, Arnaud Drieux said: This due to you module. It seems it's not compatible 1.7.x After take a look to new prestashop template 1.7 (templates/catalog/_partials/product-prices), it seems they do not use convertPrice anymore. In website root /src/Adapter/Presenter/Product/ProductlazyArray you can find $this->priceFormatter->format(xx) Maybe it's the best way to do. Thanks Arnaud Drieux, its worked for me, i have been upgrading my site from 1.6 to latest versiob 17.6.x Link to comment Share on other sites More sharing options...
Mdesign49 Posted January 26, 2020 Share Posted January 26, 2020 (edited) On 1/15/2020 at 10:29 AM, ndiaga said: Yes, in 1.7.x you can use: {assign var=currency value=Context::getContext()->currency} {Toools::displayPrice($yourprice,$currency)} be careful, it's Tools:: not Toools:: Thanks Edited January 26, 2020 by Mdesign49 (see edit history) Link to comment Share on other sites More sharing options...
depurweb Posted February 17, 2020 Share Posted February 17, 2020 where insert this string? Link to comment Share on other sites More sharing options...
theillo Posted May 11, 2020 Share Posted May 11, 2020 (edited) On 1/15/2020 at 1:01 AM, mikhsanh said: Thanks Arnaud Drieux, its worked for me, i have been upgrading my site from 1.6 to latest versiob 17.6.x Could you please say how you used this function? Previously we used {convertPrice price=$product.price} but it's no longer working. What's the code that we write into our templates now, to achieve the same thing?? There are several answers here: {$product->convertPrice($product.price)} does not work {Tools::displayPrice($product.price)} works for me right now, but also someone said it's deprecated. Edited May 11, 2020 by theillo (see edit history) Link to comment Share on other sites More sharing options...
Arnaud Drieux Posted May 11, 2020 Share Posted May 11, 2020 il y a 33 minutes, theillo a dit : Could you please say how you used this function? Previously we used {convertPrice price=$product.price} but it's no longer working. What's the code that we write into our templates now, to achieve the same thing?? There are several answers here: {$product->convertPrice($product.price)} does not work {Tools::displayPrice($product.price)} works for me right now, but also someone said it's deprecated. It seems you now need to do this in php file and not in tpl fileLike I wrote on 16July 2019: Citation [...]After take a look to new prestashop template 1.7 (templates/catalog/_partials/product-prices), it seems they do not use convertPrice anymore. In website root /src/Adapter/Presenter/Product/ProductlazyArray you can find $this->priceFormatter->format(xx) Maybe it's the best way to do. 😉 Link to comment Share on other sites More sharing options...
theillo Posted May 11, 2020 Share Posted May 11, 2020 So as a theme developer, which PHP file should I be modifying? I'm converting my PS 1.6 theme over to PS 1.7 (ssems like the OP was doing something similar) Link to comment Share on other sites More sharing options...
Arnaud Drieux Posted May 13, 2020 Share Posted May 13, 2020 Le 11/05/2020 à 11:11 PM, theillo a dit : So as a theme developer, which PHP file should I be modifying? I'm converting my PS 1.6 theme over to PS 1.7 (ssems like the OP was doing something similar) Since PS 1.7 I've never work again on prestashop template. Only module and specific dev. You need to look wich template you need to modify and find controller associated to it. Link to comment Share on other sites More sharing options...
Cernek J. Posted June 15, 2022 Share Posted June 15, 2022 Tools::convertPrice is deprecated since 1.7.4, Tools::displayPrice is deprecated Since 1.7.6.0. Use one of these in a Smarty template: {Context::getContext()->currentLocale->formatPrice($combination.price, $currency.iso_code)} Suitable if you need price format only, without currency conversion. defined as public function formatPrice($number, $currencyCode) {Product::convertandformatPrice($combination.price)} defined as public static function convertAndFormatPrice($price, $currency = false, Context $context = null) 2 Link to comment Share on other sites More sharing options...
Adrianna-27 Posted October 13 Share Posted October 13 Hola Por favor si quereis ayudar a la gente que sabe poco. Por favor poner las direccion completas. /themes/TU_TEMA/ adcasda/asdfa/asda/ sino lo que no sabemos mucho no hacemos mas que perder el tiempo sin encontrar los archivos. Animo que el teclado no se gasta por eso. Adios. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now