Prestashop 显示含税和不含税的价格



我发现了如何在产品列表中显示含税和不含税的价格。但是当有特定价格时,旧价格在有税和不含税的情况下都是一样的。它显示旧的价格税,包括即使价格不含税。 例如 : 549,0 € HT (733.20€( - 659.88 € TTC (733.20€(

{if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
<div class="content_price">
<p style="font-size: 20px;"> {l s='From'}</p>
{if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}
{hook h="displayProductPriceBlock" product=$product type='before_price'}
<div id="prix_ht">
<span class="price product-price">
{if !$priceDisplay}{convertPrice price=$product.price_tax_exc}{/if} {l s='HT.'}
</span>
{if $product.price_without_reduction > 0 && isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0}
{hook h="displayProductPriceBlock" product=$product type="old_price"}
<span class="old-price product-price">
{displayWtPrice p= $product.price_without_reduction}
</span>
{hook h="displayProductPriceBlock" id_product=$product.id_product type="old_price"}
{if $product.specific_prices.reduction_type == 'percentage'}
<span class="price-percent-reduction">-{$product.specific_prices.reduction * 100}%</span>
{/if}
{/if} </div>
<div id="prix_ttc">
<span class="price product-price">
{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}{l s='TTC'}
</span>
{if $product.price_without_reduction > 0 && isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0}
{hook h="displayProductPriceBlock" product=$product type="old_price"}
<span class="old-price product-price">
{displayWtPrice p=$product.price_without_reduction}
</span>
{hook h="displayProductPriceBlock" id_product=$product.id_product type="old_price"}
{if $product.specific_prices.reduction_type == 'percentage'}
<span class="price-percent-reduction">-{$product.specific_prices.reduction * 100}%</span>
{/if}
{/if}
{hook h="displayProductPriceBlock" product=$product type="price"}
{hook h="displayProductPriceBlock" product=$product type="unit_price"}
{hook h="displayProductPriceBlock" product=$product type='after_price'}
</div>
{/if}
</div>

我认为{displayWtPrice p=product.price_without_reduction}对于旧的无税价格不利。 但是我不知道该怎么做。你能帮我吗?周二 PS 版本是 1.6.14。

您在 product-list.tpl 中的 smarty 中已经有两个变量,您也可以在新变量中使用它并拆分税值

{assign var='totalTax' value=$total_products_wt - $total_products}
{displayWtPriceWithCurrency price=$totalTax currency=$currency}</span>

最新更新