Quoting suppressed (suppressed):
> Quoting Stefan Hornburg <suppressed>:
>
> > On Mon, 18 Apr 2005 02:36:02 -0600
> > suppressed wrote:
> >
> > > Hi folks,
> > >
> > > Running IC 5.2.0 and the total_cost tag in perl is giving me spurious
> > results,
> > > it seems to be *sometimes* (50/50) not adding the shipping value.
> > [total-cost]
> > > always returns the correct total cost its just when using it in perl. Here
> > is
> > > the snippet of code, can anyone suggest why this does not always give the
> > > correct total cost.
> > >
> > > [perl]
> > > my $price = $Tag->total_cost({noformat => 1,});
> > > $Scratch->{new-total} = sprintf("%.2f", $price);
> > > [/perl]
> >
> > Maybe total_cost tries to access a database table and isn't allowed to do so.
> >
> > Bye
> > Racke
> >
>
> Hi Racke,
>
> Maybe but would it sometimes work if that was the case, I find that for some
> shipping methods it gives the correct amount for others it doesn't. It may not
> be specifically linked to a shipping method but be something to do with the
> value of the shipping.
Stefan was giving you a hint that you likely need to pass a table
name in [perl tables="sometable othertable"].
It would work *some* of the time because you may have previously opened
the table in some pages. If you have not opened the table previously,
and total-cost uses a table -- it is almost for sure to use products --
then it will fail.
--
Mike Heins
Perusion -- Expert Interchange Consulting http://www.perusion.com/
phone +1.765.647.1295 tollfree 800-949-1889 <suppressed>
Fast, reliable, cheap. Pick two and we'll talk. -- unknown
_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.