Jump to content

NoPackPrice in product-list.tpl?


Rigtig Kaffe

Recommended Posts

We have some packs in our shop and in product.tpl it is possible to show the old price of the packs content:

{if $packItems|@count && $productPrice < $product->getNoPackPrice()}
<p id="old_price">
<span class="bold">
<span id="old_price_display">{convertPrice price=$product->getNoPackPrice()}</span>
</span>
<span id="reduction_amount"><span id="reduction_amount_display">{convertPrice price=$productPrice-$product->getNoPackPrice()}</span></span>
</p>
{/if}

How can i transfer this to the product-list.tpl so my customers can see the old price?

Link to comment
Share on other sites

  • 4 months later...
  • 1 year later...

If anyone is looking for the answer:

On line 112 of product-list.tpl after this

<div itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="content_price">
        {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}
                <span itemprop="price" class="price product-price{if isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0} product-price-new{/if}">
                        {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}
                </span>
                <meta itemprop="priceCurrency" content="{$currency->iso_code}" />

add this:

{if Pack::isPack($product.id_product)}
        {hook h="displayProductPriceBlock" product=$product type="old_price"}	
	<p>
	        {l s='Instead of'}
		<span class="old-price product-price">
		        {convertPrice price=Pack::noPackPrice($product.id_product)}
		</span>
	</p>
        {hook h="displayProductPriceBlock" id_product=$product.id_product type="old_price"}
{/if}
Edited by belyza (see edit history)
  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...