[ic] perl object for price description

Chris Fulton interchange-users@lists.akopia.com
Mon May 14 00:35:00 2001


Hello Interchange Users,

How do you use the price and descriptions of items in a globalsub? Surepay
requires each line item be sent to the payment gateway with the order. I
have a globalsub "surepay" with the following loop to get the items in the
cart, but only sku and quantity show up.


>>>>>>>>>>>>>>>>

foreach $i (0..(@{$Vend::Session->{carts}{main}}-1))
{

####these work

::logDebug("surepay itemicode= $Vend::Session->{carts}{main}[$i]{code}");
::logDebug("surepay itemimvib= $Vend::Session->{carts}{main}[$i]{mv_ib}");
::logDebug("surepay itemiqty= $Vend::Session->{carts}{main}[$i]{quantity}");

###these don't work

::logDebug("surepay itemiprice= $Vend::Session->{carts}{main}[$i]{price}");
::logDebug("surepay itemidesc=
$Vend::Session->{carts}{main}[$i]{description}");
#::logDebug("surepay itemisize= $Vend::Session->{carts}{main}[$i]{size}");
#::logDebug("surepay itemicolor= $Vend::Session->{carts}{main}[$i]{color}");
#::logDebug("surepay itemititle= $Vend::Session->{carts}{main}[$i]{title}");


###this part works, had to hardcode 1.00 for price and fake decription as
well
$lineitem =
LineItem::new($Vend::Session->{carts}{main}[$i]{code},'description',
#longline
		$Vend::Session->{carts}{main}[$i]{quantity},0,'1.00');

#  $extAmt += $lineitem->getQuantity * $lineitem->getUnitPrice;

  push(@lineitems,$lineitem);
}

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


Chris and Ben