[ic] shipping idea

Ed LaFrance interchange-users@interchange.redhat.com
Mon Dec 3 13:15:01 2001


At 09:21 AM 12/03/2001 -0600, you wrote:
> >
> > At 08:37 AM 11/30/2001 -0600, you wrote:
> > > > At 05:11 PM 11/29/2001 -0600, you wrote:
> > > > > > At 10:16 AM 11/29/2001 -0600, you wrote:
> > > > > > >I am trying to set the shipping cost based on the size
> > of the items.
> > > > > > >
> > > > > > >small = $5.00
> > > > > > >medium = $7.00
> > > > > > >I am wondering if there is a way to chain or loop this to go
> > > > throught the
> > > > > > >whole cart?
> > > > > > >
> > > > > > >So if the customer buys two small he gets charged $10.00
> > not $7.00.
> > > > > > >
> > > > > > >I have read a hundred different ways to do this. Would like
> > > > to know the
> > > > > > >correct way to get this output.
> > > > > > >
> > > > > > >Redhat 7.1 and interchange 4.8.3 (rpm)
> > > > > >
> > > > >First let me say thanks I think this will work. I have added and
> > > > modified my
> > > > >shipping.asc file to the following:
> > > > >
> > > > >FLATD   Standard
> > > >
> > >Ok I reformated and still have the same results "Note: No match found for
> > >mode 'FLATD', quantity '', returning 0." error message.
> > >
> > >I wonder if there is a way to debug this type of stuff?
> >
> > The error message suggests that criteria is not evaluating to
> > anything, but
> > I couldn't tell you why - to worked fine for me in similar context.  You
> > might want to put the [calc] block on a regular IC page (call it
> > calc.html,
> > for instance), put some sized items in the cart, then pull up
> > calc.html and
> > see what it is returning.
> >
> > - Ed L.
> >
> >
> >
> > >What i did was use the admin pages and go into items and clicked on the
> > >item. Then I clicked opions at the top. The asked me what type I
> > wanted to
> > >set up. I then selected simple as the option. I am not sure if i
> > have done
> > >this wrong or not.
> > >
> > >The big pictures is i need the price and shipping to change
> > according to the
> > >size. I have the price changeing now. But still need the
> > shipping to change
> > >on size changes.
> > >
> > >My new shipping.asc
> > >FLATD: Standard
> > >         criteria <<EOC
> > >                    [calc]
> > >                      my $total = 0;
> > >                      [item-list]
> > >                        $total += ([item-quantity] * 8.95) if
> > >q{[item-modifier size]} =~ /^S/i;
> > >                        $total += ([item-quantity] * 9.95) if
> > >q{[item-modifier size]} =~ /^M/i;
> > >                        $total += ([item-quantity] * 10.95) if
> > >q{[item-modifier size]} =~ /^L/i;
> > >                        $total += ([item-quantity] * 11.95) if
> > >q{[item-modifier size]} =~ /^XL/i;
> > >                      [/item-list]
> > >                      return $total;
> > >                    [/calc]
> > >EOC
> > >         min     0
> > >         max     999999
> > >         cost    f @@TOTAL@@
> > >
> > > > >My options.txt is as follows:
> > > > >
> > > >>code  o_master sku   o_group o_enable o_label o_value
> >  o_widget
> > >price
> > > >>AP212 1        AP212 Size    1        Size
> > m=Medium*,^Ml=Large select
> > >m==32.95,l==49.95
> > > > >
> > > > >I have remove all the collumns that are not used.
> > > > >
>I have a test.html page as follows:
>[calc]
>my $total = 0;
>[item-list]
>$total += ([item-quantity] * 8.95) if q{[item-modifier size]} =~ /^S/i;
>$total += ([item-quantity] * 9.95) if q{[item-modifier size]} =~ /^M/i;
>$total += ([item-quantity] * 10.95) if q{[item-modifier size]} =~ /^L/i;
>$total += ([item-quantity] * 11.95) if q{[item-modifier size]} =~ /^XL/i;
>[/item-list]
>return $total;
>[/calc]
>hello
>
>
>Is this correct way to do this?
>
>When i add an item to the cart that has a size then go to this test.html
>page I get:
>
>   hello
>
>Nothing else.
>
>In the error message i get on check out it talks of quantity. Is this
>correct should it be looking based on quantity? If not how should I change
>this.
>
>I am so close I can taste it.
>
>Thanks for all the help,
>Rick

I'd say that [item-modifier size] is probably not a valid call for your 
application - put some sized options in your cart and call a test page with 
these tags:
         [item-list]
         [item-modifier size]<br>
         [/item-list]



If you don't see a list of the sizes for the items in your cart, then that 
is the problem.  I'll freely admit that I have basically ignored item 
options because it is my understanding that they are not quite 
production-ready.  You need to use the correct tag to pull in the size data 
for each item in your cart - it is probably [item-options blah-blah] or 
something similar.  I suggest you study the cart component for ideas on 
what needs to be changed.

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