[ic] Conditional Discounts (inc. sample code for flypage.html)

Adrian P Wilkinson junk at puffin.org
Sat Sep 18 11:44:25 EDT 2004


Howdy,

As promised, here's some sample code for flypage.html to apply a 5.0% (to 
"disc5pc") or 2.5% (to "disc2.5pc") discount to products that are in those 
particular 'featured' groups on merchandising:

============================================================================
  [if-item-data merchandising featured eq disc5pc]
         [discount [item-code]] $s * .95 [/discount]
  [/if-item-data]

  [if-item-data merchandising featured eq disc2.5pc]
         [discount [item-code]] $s * .975 [/discount]
  [/if-item-data]

[if discount [item-code]]
  [item-list]
    <ul>
      <li><strong>Regular Price:</strong> <s><font 
color="red">[item-price]</font></s></li>
      <li><strong>Sale Price:</strong> [discount-price]</li>
      <li><strong>You Save:</strong> [item-difference]</li>
    </ul>
  [/item-list]
  [else]
  [item-list]
    <ul>
      <li><strong>Our Price:</strong> [item-price]</span></li>
    </ul>
  [/item-list]
  [/else]
[/if]
============================================================================

One small problem is that if the item isn't discounted then it won't display 
the "Our Price:" field unless that items is in your shopping basket.  I 
don't know if this is my shoddy code, a small bug in IC or a combination of 
both but it seems odd that it works as expected when in the basket but not 
once removed.

Hope this helps those that have been stuck on discounts - there appears to 
be quite a number of people judging from the mailing list archives!  If 
anyone has any suggestions re: the non-discounted price not being displayed 
when I'd welcome their comments!

Regards, Ade. 



More information about the interchange-users mailing list