Forums / Setup & design / How to add 2 discount rules on the same price attribute?

How to add 2 discount rules on the same price attribute?

Author Message

Sejal Paliwal

Monday 17 November 2008 2:17:17 am

I have created a multi-price attribute and now I want 2 rules to be applied on it.
eg -
Cover Price- $ 45 ----(My attribute)
Our Price : <calculated after applying 10 % discount rule>
Combo Offer : <calculated after applying 18 % discount rule>

I am able to implement the first discount but not the second one. Where do I need to change the settings?

The following is my template file-

{def $multiprice = $attribute.content
     $currency_code = $multiprice.currency
     $currency = fetch( 'shop', 'currency', hash( 'code', $currency_code ) )
     $locale = false()
     $symbol = false()}

    {if $currency}
        {set symbol = $currency.symbol
             locale = $currency.locale}
    {/if}

    {def $price_value = ''}
    {if $multiprice.has_discount}
        {""|i18n("design/base")} <span class="oldprice"> {$multiprice.inc_vat_price|l10n( 'currency', $locale, $symbol )}<br/>

              Our Price  <span class="currentprice">{$multiprice.discount_price_inc_vat|l10n( 'currency', $locale, $symbol )}</span> 
 {"a saving of"|i18n("design/base")} <span class="pricesave"> {$multiprice.discount_percent} % / 
{sub($multiprice.inc_vat_price,$multiprice.discount_price_inc_vat)|l10n( 'currency', $locale, $symbol )}   </span> <br>

              Combo Offer  <span class="currentprice">{$multiprice.discount_price_inc_vat|l10n( 'currency', $locale, $symbol )}</span> 
 {"a saving of"|i18n("design/base")} <span class="pricesave">{$multiprice.discount_percent} %  / {sub($multiprice.inc_vat_price,$multiprice.discount_price_inc_vat)|l10n( 'currency', $locale, $symbol )}  </span> <br>

    {else}
        {}

I need to change th e attribute for Combo Offer so that it applies the second rule defined in Discount rule. How can I do that?

Please guide.

Thanks in advance!!