[ic] Redefine variable

Ed LaFrance interchange-users@interchange.redhat.com
Mon Sep 10 12:21:01 2001


At 09:51 AM 09/10/2001 -0500, you wrote:
> > -----Original Message-----
> > From: interchange-users-admin@interchange.redhat.COM
> > [mailto:interchange-users-admin@interchange.redhat.COM]On Behalf Of
> > mheins@redhat.COM
> > Sent: Friday, September 07, 2001 3:12 PM
> > To: interchange-users@interchange.redhat.COM
> > Subject: Re: [ic] Redefine variable
> >
> >
> > Quoting Ron Phipps (rphipps@reliant-solutions.com):
> > > > From: interchange-users-admin@interchange.redhat.com
> > > [mailto:interchange-
> > > > users-admin@interchange.redhat.com] On Behalf Of Chad Wittrock
> > > >
> > > > Is there a way I can redefine a variable within IC? I would like to
> > > > redefine
> > > > [shipping] from its default to :
> > > >   [set total_shipping]0[/set]
> > > >   [item-list]
> > > >                   [seti total_shipping][calc]
> > > >                   [scratch total_shipping] + ([item-field
> > > shipping] *
> > > > [item-quantity])
> > > >                   [/calc][/seti]
> > > >   [/item-list]
> > > >   [set shipping][scratch total_shipping][/set]
> > > >
> > > > Where do I find where [shipping] is defined or is this not possible?
> > >
> > > You may want to look into using the standard shipping routines instead
> > > of redefining what shipping does.  It seems like you could setup a
> > > formula in the shipping.asc to use the shipping field for each product
> > > to determine the shipping amount.  Take a look at the shipping
> > > documentation for how to setup formulas.
> >
> > That particular one is quite easy, unless I am missing something:
> >
> > STD   Standard Shipping       shipping        0       0       e
> > Nothing to ship!
> > STD   Standard Shipping       shipping        0       99999   f @@TOTAL@@
> >
>
>I added these lines (tab seperated fields per line) to shipping.asc and
>restarted interchange. When I visit my cart, I get a value of $0.00 for
>shipping instead of the correct amount. I am displaying [shipping] at my
>cart. This is correct right? Have I missed something? I am new to editing
>shipping.asc. I read over the minivend shipping documents and I think I did
>this correctly.
>
>Can you give me some more assistance?
>

You need to determine why shipping is evaluating to zero.  Do you have a 
column named shipping in your products table, and did you load it with 
values for each item?  Did you add the mode 'STD' to the appropriate column 
in your country table?  Did you make it the default shipmode in your 
catalog.cfg 
(http://ic.redhat.com/cgi-bin/ic/dev-4.8/icconfig_83.html)?  Put [data 
session ship_message] on your pages/ord/checkout.html page - what does it 
say?  On the first line of the new entries for shipping.asc add a message 
after 'e', like 'got zero shipping line', and see if that message shows up 
on the checkout page as [data session ship_message]; that would tell you 
that the shipping routine is not getting the accumulated value of shipping 
for some reason.

Also the space between 'f' and '@@TOTAL@@' is a space character, not a tab 
(likewise for 'e' and your error message).  If you downloaded shipping.asc 
and edited it on a Bill Gates wonderbox, it may contain carriage returns; 
strip them out thusly on the *nix command line, from within the products 
directory:

perl -i.bak -p -e 's/\r//g' shipping.asc

That's all I can think for now.

- Ed L.



===============================================================
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
===============================================================