Jump to content

sale amount in featured products


Recommended Posts

take a look on this code:
 

			{if $product.price_without_reduction neq $product.price}
				{if $product.specific_prices}
					<div class="reduction_corner">
						{assign var='pro_specific_prices' value=$product.specific_prices}
						<span class="reduction_corner_text">
							{if $pro_specific_prices.reduction_type eq 'percentage' && ($pro_specific_prices.from eq $pro_specific_prices.to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $pro_specific_prices.to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $pro_specific_prices.from))}
								-{$pro_specific_prices.reduction * 100|floatval}%
							{/if}
						</span>
						<span class="reduction_corner_price_text">
							{if $pro_specific_prices.reduction_type neq 'percentage' && ($pro_specific_prices.from eq $pro_specific_prices.to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $pro_specific_prices.to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $pro_specific_prices.from))}
								-{number_format($pro_specific_prices.reduction, 0 , ',' , ' ')},-     {* !!!PAs, no decimals and symbol in reduction amount *}
							{/if}
						</span>
					</div>
				{/if}
			{/if}

it's a code proposed by @PascalVG

  • Like 1
Link to comment
Share on other sites

it totally works! thanks (that should be a backoffice option, the featured products is the most important thing in home page, and for a whole ecommerce)

 

just 1 thing i see the sale amount, but the original price?

 

i tried to simply paste the special module code

<span class="price-discount">{if !$priceDisplay}{displayWtPrice p=$special.price_without_reduction}{else}{displayWtPrice p=$priceWithoutReduction_tax_excl}{/if}</span>
					<span class="price">{if !$priceDisplay}{displayWtPrice p=$special.price}{else}{displayWtPrice p=$special.price_tax_exc}{/if}</span>

doesnt work

Edited by alfredopacino (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

since the pascalvg code shows the original price in product not in sale too, something like that:

100$

100$

 

at the end i changed my mind, shows just the original price is enough, im using just this part

{if $product.price_without_reduction neq $product.price}
	<span class="price-original">
		{if !$priceDisplay}
			{displayWtPrice p=$product.price_without_reduction}
		{else}
			{displayWtPrice p=((($product.price_without_reduction) / (1 + ((($product.rate|intval) / 100)|floatval)))|floatval)}	
		{/if}
	</span>
{/if}

thanks to all :)

Edited by alfredopacino (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...