Multi-price products
A product sells in several currencies when its class has a Multi-price attribute (datatype ezmultiprice) instead of a Price attribute. The webshop then uses the visitor's preferred currency in the product view, the basket and the order.
Setting up the class
- Under Setup > Classes, edit the product class and add a Multi-price attribute (or convert an existing Price attribute).
- Choose its default currency, and whether prices are entered including or excluding VAT, in the attribute's settings.
Editing a product
The edit form lists one price per currency of the currency list:
- select a currency and click Set custom price to enter a price by hand;
- prices without a custom value are marked Auto and calculated from the first custom price (see Custom prices and auto prices);
- Remove selected turns custom prices back into auto prices;
- the VAT type applies to all prices of the attribute.
When the currency list is empty, the form says so; create the currencies first.
In templates
The attribute's content is an eZMultiPrice object. Like the Price datatype it has inc_vat_price, ex_vat_price and currency, which are the values in the visitor's preferred currency, and price_list, custom_price_list and auto_price_list for all currencies.
{def $price = $node.data_map.price.content
$currency = fetch( 'shop', 'currency', hash( 'code', $price.currency ) )}
{$price.inc_vat_price|l10n( 'currency', $currency.locale, $currency.symbol )}
Limits
- One price per currency per product.
- A class should use either Price or Multi-price for its products, not both.
Contributors
- Svitlana Shatokhina
- Andrea Melo Maintainer
- Geir Arne Waaler Maintainer
- Graham Brookins Updated Maintainer
Comments
Add a comment