[ic] globalsub broken when implementing CommonAdjust

Russ Mann interchange-users@interchange.redhat.com
Tue Jan 22 13:34:01 2002


Dear Ed,

Thank you for your reply, however it did not fix the problem.  From what I
can tell, "price" is modified by the CommonAdjust system, so it's probably
part of the problem.  I try to just use the database field price in this
sub.  The variables in the Sub are localized, so I don't see how that would
affect the output of the mathematics.

Any other ideas?

-Russ

-----Original Message-----
From: interchange-users-admin@interchange.redhat.com
[mailto:interchange-users-admin@interchange.redhat.com]On Behalf Of Ed
LaFrance
Sent: Tuesday, January 22, 2002 10:27 AM
To: interchange-users@interchange.redhat.com
Subject: Re: [ic] globalsub broken when implementing CommonAdjust


At 09:57 PM 01/21/2002 -0700, you wrote:
>Hello List,
>
>I've been using a global sub for quite a while to do some math and return
>the percentage of savings a user is getting on a product:
>
>GlobalSub <<EndOfSub
>sub you_save_percent {
>my($retail, $price) = @_;
>my($yousave);
>if (($retail > 0)&&($price > 0))
>{
>$yousave = ((1-($price/$retail))*100)+.5001;
>$yousave = int($yousave);
>$yousave .= "\%";
>}
>   return $yousave;
>}
>EndOfSub
>
>This is called like this:
>[perl arg=sub interpolate=1] you_save_percent ([item-field retail],
>[item-field price])[/perl]

Shouldn't that be [perl arg=subs global=1 interpolate=1]?

- Ed L.


>I just switched to using CommonAdjust because I want to take advantage of
>the price group feature.  For some reason this broke the Global Sub.
>
>I get this error:
>
>63.14.69.58 zAD78XEt:63.14.69.58 - [21/January/2002:20:31:41 -0800] catalog
>/store/catalog/BP050.html Safe: Unable to create sub named
>"*MVSAFE55822::you_save_percent" at (eval 433) line 1.
>
>  you_save_percent (14.95, 12.70)
>
>
>Any ideas?
>
>-Russ
>
>_______________________________________________
>interchange-users mailing list
>interchange-users@interchange.redhat.com
>http://interchange.redhat.com/mailman/listinfo/interchange-users

===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================

_______________________________________________
interchange-users mailing list
interchange-users@interchange.redhat.com
http://interchange.redhat.com/mailman/listinfo/interchange-users