There are several ways that MiniVend can modify the price of a product during normal catalog operation. Several of them require that the pricing.asc file be present, and that you define a pricing database. You do that by placing the following directive in catalog.cfg:
Database pricing pricing.asc 1
NOTE: PriceAdjustment is slightly deprecated by CommonAdjust, but will remain in use at least through the end of Version 3 of MiniVend.
Configurable directives and tags with regard to pricing:
price
in the pricing database. The price field contains a space-separated list of prices that correspond to the
quantity levels defined in the
PriceBreaks directive. If quantity is to be applied to all items in the shopping cart
(as opposed to quantity of just that item) then the
MixMatch directive should be set to Yes.
For example, if you decided to adjust the price of T-shirt part number 99-102 up 1.00 when the size is extra large and down 1.00 when the size is small, you would have the following directives defined in <catalog.cfg>:
Database pricing pricing.asc 1 UseModifier size PriceAdjustment size
To enable the automatic modifier handling of MiniVend 3.0, you would define a size field in products.asc:
code description price size 99-102 T-Shirt 10.00 S=Small, M=Medium, L=Large*, XL=Extra Large
You would place the proper tag within your [item-list]
on the shopping-basket or order page:
[item-accessories size]
In the pricing.asc database source, you would need:
code S XL 99-102 -1.00 1.00
As of MiniVend 3.06, if you want to assign a price based on the option, precede the number with an equals sign:
code S M L XL 99-102 =9.00 =10 =10 =11
IMPORTANT NOTE: Price adjustments occur AFTER quantity price breaks, so the above would negate anything set with the PriceBreaks directive/option.
Numbers that begin with an equals sign (=
) are used as absolute prices and are interpolated for MiniVend tags first, so you can use subroutines to set the price. To facilite coordination
with the subroutine, the session variables item_code
and item_quantity
are set to the code and quantity of the item being evaluated. They would be
accessed in a global subroutine with $Vend::Session-
>{item_code}
and $Vend::Session-
>{item_quantity}
.
The pricing information must always come from a database because of security.