<{if $product->hasVariants() && !$product->getExtensionValue('hide_variants_pricetable')}>
<{assign var="getvariants" value=$product->getInStockVariants()}>
|
<{foreach from=$getvariants item="variant"}>
<{$variant.name}> |
<{/foreach}>
<{section name="a" loop=$intervals}>
<{assign var="discountedPrice" value=$product->getDiscountIntervals()}>
<{math assign="discountPercentMath" equation="(((x)-y)/(x))*100" y=$product->getDiscountIntervalPrice($intervals[a]) x=$product->getPrice() z=$intervals[j]}>
|
|
<{foreach from=$getvariants item="variant"}>
<{t section="General" x=$product->getDiscountIntervalPrice($intervals[a], $variant.attribute_value_id)|number_format:2:$smarty.capture.decimal:$smarty.capture.thousand }>{x} / unit<{/t}>
|
<{/foreach}>
<{/section}>
<{elseif $product->hasVariants() && $product->getExtensionValue('hide_variants_pricetable')}>
<{assign var="getvariants" value=$product->getInStockVariants()}>
<{section name="a" loop=$intervals}>
<{assign var="discountedPrice" value=$product->getDiscountIntervals()}>
<{math assign="discountPercentMath" equation="(((x)-y)/(x))*100" y=$product->getDiscountIntervalPrice($intervals[a]) x=$product->getPrice() z=$intervals[j]}>
|
|
<{foreach from=$getvariants item="variant" key="index"}>
<{if $index == 0}>
<{t section="General" x=$product->getDiscountIntervalPrice($intervals[a], $variant.attribute_value_id)|number_format:2:$smarty.capture.decimal:$smarty.capture.thousand }>{x} / unit<{/t}>
|
<{/if}>
<{break}>
<{/foreach}>
<{/section}>
<{else}>
<{section name="j" loop=$intervals}>
<{math assign="var2" equation="x * y" x=$intervals[j] y=$product->getPrice() }>
<{math assign="var4" equation="x * y" x=$intervals[j] y=$product->getDiscountIntervalPrice($intervals[j]) }>
<{math assign="var6" equation="x - y" x=$var2 y=$var4 }>
<{math assign="discountPercentMath" equation="(((x)-y)/(x))*100" y=$product->getDiscountIntervalPrice($intervals[j]) x=$product->getPrice() z=$intervals[j]}>
<{assign var="discountPercent" value=$discountPercentMath|number_format:0 }>
|
|
<{t section="General" x=$product->getDiscountIntervalPrice($intervals[j])|number_format:2:$smarty.capture.decimal:$smarty.capture.thousand y=$currency}>{x} {y} pr unit<{/t}>
|
<{capture name="discount_interval_sale_badge_text"}>
<{t x=$discountPercent}>Save {x}%<{/t}>
<{/capture}>
<{include file="components/badge.html" class="" variant="onsale" text=$smarty.capture.discount_interval_sale_badge_text}>
|
<{/section}>
<{/if}>