Zimnel
Zimnel

Reputation: 61

How to display price in product page with and without tax in Prestashop 1.7?

I found this workaround for version 1.6 here: How to display product price with and without tax at a time in product list for Prestashop?

but the code for product-list.tpl changed a lot in 1.7

Is there a workaround for 1.7?

Thanks in advance!

Upvotes: 6

Views: 6518

Answers (2)

lucrp
lucrp

Reputation: 582

Since version 1.7.6, displayPrice method is deprecated. Use formatPrice instead. For example in templates/catalog/_partials/miniatures/_partials/product-prices.tpl:

{block name='product_without_taxes'}
    {if $priceDisplay != 1}
        <p class="product-without-taxes">{l s='%price% tax excl.' d='Shop.Theme.Catalog' sprintf=['%price%' => Context::getContext()->currentLocale->formatPrice($product.price_tax_exc, $currency.iso_code)]}</p>
    {/if}
{/block}

Upvotes: 0

marsaldev
marsaldev

Reputation: 3349

The file to edit is:
psroot/themes/classic/templates/catalog/_partials/miniatures/product.tpl

To display the price vat excl use this snippet (find the position in the html where do you want to display):

{Tools::displayPrice($product.price_tax_exc)}

PS: Pay attention to the rich snippet and SEO

Upvotes: 8

Related Questions