[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ic] How to obtain discount price from the shopping cart


I am having a problem finding how I can get the discount price in the shopping cart to calculate shipping. I am using quantity discounting, but I can't seem to find the discount price inside my shipping usertag. It must be simple, but I can't find it searching the archives or the documentation. I am using IC 4.9.7-200305121041, RH Linux 7.2 . I can get the price from the products table, but that is not the discount price for quantities. Here is the partial of my usertag where I am getting the price from the products table.

Thanks for any help,

--------------------------------------------------
     my $cart = $Carts->{main};

     # loop through the cart items
     foreach my $item (@$cart)
     {
          $price = $Tag->data(
                   {table => 'products',
                   field => 'price',
                   key => $item->{code},}
                   );

          # add the quantity to the total number of items
          $totalItems+= $item->{quantity};

          # if sku starts with VT (video) or CD then it is an exception
          if ( ( $item->{code} =~ /^VT/ ) || ( $item->{code} =~ /^CD/ ) )
          {
               # add the quantity of the video or cd to the exceptions
               $exceptions+= $item->{quantity};
          }

          else  # sub total without the video or cd costs
          {
               # add the price * quantity to the sub total
               $subTot+= ($price * $item->{quantity});
          }
     }


---------------------------------------------------------------
Jim Boyer
Systems Programmer
Information Dept
College of Agriculture and Home Economics
Washington State University

_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.