Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Price fields compared

The two price datatypes of the Exponential shop side by side - ezprice and ezmultiprice - with VAT included or excluded, the class defaults, custom and automatic prices per currency, the update buttons of the currency…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/e-commerce/catalog/price-fields-compared.md

On this page

Price fields compared

This page is for developers and merchants who choose the price field of a product class. Exponential ships two price datatypes. The choice decides how prices are entered, how several currencies work and how prices look in an import file, so it is worth making on purpose.

Contents

  1. Side by side
  2. VAT included or excluded
  3. How ezmultiprice handles currencies
  4. Text formats for imports and exports
  5. Which one to choose
  6. Changing later

Side by side

ezpriceezmultiprice
Prices per productOne amountOne amount per currency
CurrencyThe shop's [CurrencySettings] PreferredCurrency (shop.ini)Each price carries its currency code; the class sets a default currency
VAT typeChosen per product, default from the classSame
Price includes VATPer product, default from the classSame
Converted pricesNoYes: "automatic" prices calculated from exchange rates
Admin screens involvedContent editContent edit and Store > Currencies (shop/currencylist)
Sourcekernel/classes/datatypes/ezprice/ezpricetype.phpkernel/classes/datatypes/ezmultiprice/ezmultipricetype.php, kernel/shop/classes/ezmultipricedata.php

VAT included or excluded

Both datatypes store whether the entered amount includes VAT (INCLUDED_VAT = 1) or excludes it (EXCLUDED_VAT = 2), and which VAT type applies. The class definition sets the defaults that a new product starts with. Choose one convention for the whole store and tell editors; a mix of "including" and "excluding" products is the most common source of wrong totals. The VAT type can be "Determined by VAT charging rules" when VAT rules are used (Product categories and VAT rules).

How ezmultiprice handles currencies

Each price row of an ezmultiprice field has a currency code, a value and a type (kernel/shop/classes/ezmultipricedata.php):

TypeConstantMeaning
CustomVALUE_TYPE_CUSTOM = 1Entered by hand; never changed by the system
AutomaticVALUE_TYPE_AUTO = 2Calculated from another price with the currency's exchange rate

The currency list (shop/currencylist, policy shop/setup) has the buttons that drive this:

ButtonWhat it does
New currencyAdds a currency; automatic prices are created for existing products
Update autoratesFetches exchange rates with the configured handler (shipped: eZECB, the European Central Bank)
Update autopricesRecalculates every automatic price from the current rates
Apply changesSaves edited rates and settings of the listed currencies

Rates are not updated by a cron job in the shipped settings; someone presses the buttons, or a developer schedules it. Rounding follows shop.ini [MathSettings] (shop.ini walkthrough). Daily currency work is described for owners in Prices and currencies.

Text formats for imports and exports

The CSV import and export and other tools that use a datatype's text form read and write these formats (fromString() and toString() of each datatype):

DatatypeFormatExample
ezpriceprice|vat_type_id|vat_included where the last part is 1 (included) or 0 (excluded)19.90|1|1
ezmultipricevat_type_id|vat_included|CUR|value|TYPE|CUR|value|TYPE... with TYPE one of CUSTOM, AUTO1|1|EUR|19.90|CUSTOM|USD|21.50|AUTO

An ezprice value that is not a number is refused rather than stored as zero, and an incomplete trailing currency triple of an ezmultiprice value is left out. Check the VAT type ids in Store > VAT types before preparing a file.

Which one to choose

Your storeChoose
Sells in one currencyezprice
Shows prices in several currencies but charges in oneezprice, and explain the conversion on the page
Sells in several currencies, prices set per marketezmultiprice with custom prices
Sells in several currencies, prices follow exchange ratesezmultiprice with automatic prices

Changing later

There is a script for the most common move: bin/php/convertprice2multiprice.php converts the ezprice attributes of content objects to ezmultiprice, keeping the existing prices, and creates the shop's currency when it does not exist yet (kernel/private/classes/commands/convertprice2multiprice.php). Before running it:

  • To do: Take a backup of the database (Backups and restores).
  • To do: Run it on a copy of the site first and check prices in Store > Products overview.
  • To do: Test every template that shows a price, the basket and a full order afterwards.

The opposite direction has no script. Decide before the catalog grows.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x