[ic] how to calculate item-subtotal by the item price *and* packingunit

Joachim Leidinger interchange-users@icdevgroup.org
Fri Aug 16 05:47:02 2002


Kevin Walsh wrote:
...

>>>>sku  description    Qt.(Unit)  price   unit   item total
>>>>1234 soap           1          0.50 $  72     36.00 $
>>>>
>>>>Can I use CommonAdjust to calculate the item total with
>>>>
>>>>price * quantity + field unit
...

>>For example
>>
>>########
>># change the item-subtoal
>>#
>>#
>>UserTag myitemsubtotal Interpolate 1
>>UserTag myitemsubtotal Routine <<EOF
>>sub {
...

>>What do you think?
>>
> 
> That would not change the value returned by [item-subtotal],
> although you could use [item-modifier subtotal] to read your new
> 'subtotal' hash key.

Right!


> You could also modify your UserTag for use with the [assign] tag,
> to override the value returned by [subtotal].  Your tag could do what
> it does now, and then return a subtotal for assignment, or do the
> assignment itself.

Or use

$Vend::Session->{assigned}{subtotal} = $mynewsubtotal;

?


> I still think the best way would be for you to create a UserTag
> for use with CommonAdjust; It's just more 'supported' than any
> other method you might think of.

You mean

CommonAdjust  [my-usertag-for-the-new-item-subtotal]

? Would that not change the price ([item-price]) only? For example, 
would that not displays

sku  description    Qt.(Unit)  price   unit   item total
1234 soap           1          36.00 $  72     36.00 $

instead of

sku  description    Qt.(Unit)  price   unit   item total
1234 soap           1          0.50 $  72     36.00 $

?

It seems to me, my brain is down in the moment! :-(

Thank you!

Joachim




-- 
Hans-Joachim Leidinger | Dipl.-Phys.Ing. Entwicklung eCommerce
[leidinger@bpanet.de]
Black Point Arts Internet Solutions GmbH
http://www.bpanet.de