[ic] Unexpected interpolation of [discount-price]

Mike Heins interchange-users@icdevgroup.org
Tue Feb 4 20:03:01 2003


Quoting John Rennie (john.rennie@thechampagneshop.co.uk):
> Hi all,
> 
> There are occasions (specifically when it's viewed for editing on a
> page or component in the UI) when [discount-price] is converted from
> a tag into $0.00, when it shouldn't be interpolated -- just as other
> tags aren't converted.
> 
> For example, create a new page, enter [discount-price] as the
> content. Save the page, then get the UI to reload it. The content
> is now $0.00 (just confirmed in latest demo on web).
> 
> I've (sort of) tracked this down to the following statement 
> (starts on line 4668 in revision 2.145 of Interpolate.pm):
> 
>   $run =~ s!$B$QR{_discount_price}!
>           currency(
>             discount_price($item, item_price($item,$1), $1 || 1)
>                              , $2
>                             )!ge
>           or
>             $run =~ s!$QR{discount_price}!
>                     currency(
>                       discount_price($item, item_price($item,$1), $1 ||
> 1)
>                                         , $2
>                                         )!ge;
> 
> If the section after the 'or' is removed, then the editor works fine
> - but this breaks operation of this tag in normal use :(
> 
> Any got any ideas for the correct fix? I've learnt a lot about
> Interchange internals by tracking this, but not enough!
> 
> BTW, the tag is used in the 'Shopping cart (full)' component in the
> current
> Foundation demo, and you can see the same problem if you edit that in
> the
> (otherwise excellent) new component editor.

I would be happy to fix this if I could figure out what you 
are talking about.

Could you provide a small self-contained snippet of ITL which
illustrates the probem?

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

I am a great believer in luck, and I find that the harder I work
the more luck I have. -- Thomas Jefferson