[ic] quantity pricing
k
palazani at gmx.net
Mon Feb 16 08:50:19 EST 2004
Is there an easy way to indicate an active quantity price, like [if discount
xxx]?
Now I compare the real-price and the database price for each item in the
cart. If the prices are different, its a quantity price and I can show the
user a icon or a text which indicates the quantity price.
But I have one problem if the item is a variant, so I have to compare the
real-price and the price which comes form the variants table. The tests are
done in an [item-calc]-sequence, but in it I have no access to the variants
table.
Here are my tests to fetch the variants price in the [item-calc]-sequence,
which lives in the [item-list] of the cart:
[item-calc]
# test one
Log("[item-data variants price]");
# no result
# test two
Log("[data table=variants key=[item-code] field=price]");
# the error.log shows ...skipping...
# test three
$set = $Db{variants}->query("select price from variants where
code='[item-code]'");
for (@$set) {
Log("$_->[0]");
}
# the error.log shows ...skipping...
[/item-calc]
If I do the same in a [perl tables="products variants"]-sequence the result
is like the above ones.
For the moment I fetch the variants price outer the [item-calc]-block, but
its parsed after the [item-calc] block, so if an item is ordered its
indicated as a quantity price even if is not so. After refreshing the cart
or ordering a second one its done right. But this is not nice.
Thanks for any hints!
k.
More information about the interchange-users
mailing list