Jump to content

Recommended Posts

Hola a todos,

Tengo Prestashop 1.7.6 configurado con dos decimales. Esto lo respeta con el precio normal. Pero si le aplico un descuento en %, el precio resultante me lo mestra con cuatro decimales.

He intentado modificar product-prices-tpl:

<div class="current-price">
          <span itemprop="price" content="{$product.price_amount}">{$product.price}</span>

cambiandolo por:

<div class="current-price">
          <span itemprop="price" content="{$product.price_amount}">{round($product.price, 2)}</span>

Pero entonces sólo muestra el número entero, sin decimales. Y de lo que se trata es que muestre los dos decimales.

adjunto captura de pantalla

 

Saludos y gracias.

decimales-en-precio.jpg

Share this post


Link to post
Share on other sites

Solucionado.

He cambiado en el tpl:

<div class="current-price">
          <span itemprop="price" content="{$product.price_amount}">{$product.price}</span>

por:

<div class="current-price">
          <span itemprop="price" content="{$product.price_amount}">{Tools::displayPrice(round($product.price_amount, 2))}</span>

Gracias,

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More