[ic] Discounting Entire Orders

Kevin Walsh interchange-users@interchange.redhat.com
Wed Oct 24 08:50:00 2001


> > > Well, take a look at this doc:
> > > http://interchange.redhat.com/cgi-bin/ic/dev-4.8/ictags_24.html
> > >
> > > ..and consider something like this, on ord/checkout.html, top of page:
> > >
> > > [if type=explicit compare="[calc][subtotal noformat=1] > 100[/calc]"]
> > >          [discount ENTIRE_ORDER]$s * .9[/discount]
> > > [else]
> > >          [discount ENTIRE_ORDER][/discount]
> > > [/else]
> > > [/if]
> > >
> > Oh! Wow! Fan-$#%$&*(&ing-tastic!
> >
> That is VERY valuable! Thanks a whole lot! Just bear in mind that
> does not work in the strictest sense because it
> sets the session permanently.  One could set the discount, drop a few
> items, and still have the discount.  That might be irrelevant or it
> might not :-)  It even gets page dependant, eg they may not have to
> go through checkout once it is filled.  I suppose you could simply
> unset it each page and reset; the [else] won't quite do that.
>
Try something like the following code:

    [discount ENTIRE_ORDER]
        $s > 100 ? $s * 0.9 : $s;
    [/discount]

That should set the discount as expected, and should save having to
use hundreds of tags to do it.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.uk.com
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/