Fwd: RE: [ic] Size based shipping (almost got it)

Ed LaFrance interchange-users@interchange.redhat.com
Wed Dec 5 12:45:04 2001


>Delivered-To: newmediaems-com-edl@newmediaems.com
>From: "Rick Eicher II" <rick@texol.net>
>To: <interchange-users@interchange.redhat.com>
>Subject: RE: [ic] Size based shipping (almost got it)
>X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
>Importance: Normal
>Sender: interchange-users-admin@interchange.redhat.com
>X-BeenThere: interchange-users@interchange.redhat.com
>X-Mailman-Version: 2.0.7
>Reply-To: interchange-users@interchange.redhat.com
>List-Help: 
><mailto:interchange-users-request@interchange.redhat.com?subject=help>
>List-Post: <mailto:interchange-users@interchange.redhat.com>
>List-Subscribe: 
><http://interchange.redhat.com/mailman/listinfo/interchange-users>,
> 
><mailto:interchange-users-request@interchange.redhat.com?subject=subscribe>
>List-Id: Interchange users discussion (high volume) 
><interchange-users.interchange.redhat.com>
>List-Unsubscribe: 
><http://interchange.redhat.com/mailman/listinfo/interchange-users>,
> 
><mailto:interchange-users-request@interchange.redhat.com?subject=unsubscribe>
>List-Archive: <http://interchange.redhat.com/pipermail/interchange-users/>
>X-Original-Date: Wed, 5 Dec 2001 09:48:12 -0600
>Date: Wed, 5 Dec 2001 09:48:12 -0600
>
>Ok I almost have this working. Every thing works but the if statement.
>
>Here is my user tag now:
>
>#Shipping user tag
>
>
>UserTag ship Routine <<EOF
>sub{
>package Vend::Interpolate;
>my $total =0;
>
>for(@$Items) {
>#if {$Tag->accessories('size') =~ /^s/i} {$total += $_->{quantity} * 8.95;}
>if {$Tag->accessories{'Size'} =~ /^m/i} {$total += $_->{quantity} * 9.95;}

I can't vouch for the code as a whole, but here are a couple of corrections:

for (@$Items) {
         if ($_->{'size'} =~ /^m/i) {$total += $_->{quantity} * 9.95;}
         # ...more conditions...
}

Note that this assumes the there is an option named 'size' for each item in 
the cart; you can always verify what is in your current cart by doing a 
[dump] (which is what you see in UI->Administration->Active Sessions).

- Ed L.


>#if {$Tag->accessories('size') =~ /^l/i} {$total += $_->{quantity} * 10.95;}
>#if {$Tag->accessories('size') =~ /^xl/i} {$total += $_->{quantity} *
>11.95;}
>}
>return $total;}
>EOF
>
>
>I just can not figure out how to do the "$Tag->accessories{Size}" part. I
>need it to find the option "size" I have set up for the item. Once i get
>this I am done. How should this be done?
>
>My option.txt is:
>
>AP212 1 AP212   Size  1  Size    m=Medium*,^Ml=Large    select
>m==32.95,l==49.95
>
>
>Thank you all for the help,
>Rick
>
>_______________________________________________
>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
===============================================================