[ic] logic based on shipping weights

Mark Bryant interchange-users@icdevgroup.org
Tue May 6 05:52:00 2003


Hi Folks,

I'm trying to get a row printed into a table in the basket when the 
shipping weight is over 10000. I'm using the following code, but I can't 
see what's wrong with it.

<table cellspacing="0" cellpadding="4" border="0">
   <tr>
     <td align=left class="contentbar1">Shipping Weight:</td>
     <td class="contentbar1" align="right">[summary total=1] grammes</td>
   </tr>
[perl]
   my $myout = '';
   if ([shipping total=1] > 10000) {
     $myout = "<tr><td colspan=2><small>Cart is too heavy for shipping. Max 
10000 grammes.</small></td></tr>";
   }
   return $myout;
[/perl]
</table>


Everything seems to be OK until I hit my [perl][/perl] and then I get 
things in the error.log for the catalog as follows:

supercow.vwe.net 787S5Fhh:vwe.net - [06/May/2003:09:43:24 +0000] eros 
/cgi-bin/eros/process.html Safe: Can't locate object method "shipping" via 
package "total" (perhaps you forgot to load "total"?) at (eval 245) line 3.
 >
 >
 >   my $myout = '';
 >   if ([shipping total=1] > 10000) {
 >     $myout = "<tr><td colspan=2><small>Cart is too heavy for shipping. 
Max 10000 grammes.</small></td></tr>";
 >   }
 >   return $myout;
 >
 >

Does anyone know what I've done wrong here? The [shipping total=1] tag 
seems to be working fine in the <TD> line above, so why isn't it working in 
the [perl][/perl] statement?

I'm using IC 4.8.7 from an rpm install on RH 7.3.

Many thanks

Mark