qlio Posted January 16 Share Posted January 16 Me ha pedido un cliente que le ponga el precio por metro para algunos productos en la vista de la categoría. He podido añadirlo con el siguiente fragmento de código {block name='product_unit_price'} {if $product.unit_price_ratio > 0} <p class="product-unit-price sub">{$product.unit_price_tax_included} € metro</p> {/if} {/block} En el fichero themes/classic/templates/catalog/_partials/miniatures/product.tpl Pero me muestra 28.999950819914 € metro y necesitaría redondearlo a 29 € metro. ¿Alguna ayuda? Link to comment Share on other sites More sharing options...
zitarka Posted January 17 Share Posted January 17 Has probado a usar round()? Link to comment Share on other sites More sharing options...
qlio Posted January 17 Author Share Posted January 17 6 minutes ago, zitarka said: Has probado a usar round()? Si, pero no ha funcionado. Gracias. Link to comment Share on other sites More sharing options...
qlio Posted January 17 Author Share Posted January 17 Solucionado, lo copio aquí porque si le sirve a alguien mas: {if $product.unit_price_ratio > 0} <p class="product-unit-price sub">{round($product.unit_price_tax_included, 2, PHP_ROUND_HALF_UP)} € metro</p> {/if} 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