[ic] Controlling checkout.html shipping method selections

Ed LaFrance interchange-users@icdevgroup.org
Sun May 4 12:05:01 2003


At 10:07 AM 5/4/2003 +0100, you wrote:
>Hi Folks,
>
>I'm having a bit of trouble with the shipping methods displayed on 
>checkout.html.
>
>I've already set up two shipping methods (let's call them SHIP1 & SHIP2), 
>where the calculation is done by weight and they are behaving normally.
>
>What I would like to do now is customise which one is displayed by 
>checkout.html dependent on the cost of the goods+sales tax :
>
>
>     [if] (the cost of the goods + sales tax <= 28.00)
>
>        Show both methods in checkout.html
>
>     [if] (the cost of the goods + sales tax > 28.00)
>
>        Only show method SHIP2 in checkout.html
>
>     [/if]
>
>
>The checkout.html page is currently showing both methods using this code, 
>which I guess if just fine in the < 28.00 case, but not for the > 28.00 case.
>
>     <SELECT NAME=mv_shipmode>
>     [shipping
>       label=1
>       mode=|[data table=country key='[default country UK]' col=shipmodes]|
>     ]
>     </SELECT>
>
>
>I'll freely admit that I don't understand how most of the IC tags/code 
>work and having spent hours looking at code and getting nowhere fast I 
>have to ask if someone out there could supply the code (or enough of it to 
>get me going) to do the job. I'm sure it's pretty simple if you understand 
>how getting data from the databases works, but I'm so lame with IC right 
>now I couldn't even write the required [if][/if] lines :o(
>
>Many thanks to anyone that can help out here.
>
>Mark

I'll start by saying that I've never tried it before, but according to the 
docs, your shipping formula can contain any mixture of ITL and Interchange 
Perl objects as part of the expression, so this *should* work:

SHIP1   Shipping method 1       weight  0       9999    f if ( 
$Tag->subtotal({ noformat => 1}) + $Tag->salestax({ noformat => 1}) <= 28 ) 
{ #your shipping formula here }

- Ed L.


===============================================================
*** PLEASE NOTE: Office will be closed 05/05/03 - 05/13/03 ***
===============================================================
New Media E.M.S.              Technology 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
===============================================================