Loading...
Skip navigation
Please note that this documentation is for the most recent version of this extension. It may not be relevant for older versions. Related documentation can be found in the documentation directory of the extension.

Base prices

Base prices show the unit price per a defined reference quantity (e.g. per 1 kg, per 1 l, per 100 g) in addition to the sales price. This helps customers compare products and complies with EU price indication rules.

How it works in the shop

  • In the product record you define the net content of the product and its unit (e.g. 750 ml, 2 kg, 100 g, 3 l, ...).
  • You also define the reference quantity and its unit for which the base price should be displayed (e.g. 1 l, 1 kg, 100 g, ...).
  • The shop calculates the base price dynamically from the current sales price (including discounts) and displays it in the frontend.

Product fields involved

  • Net content: Numeric content amount stored in field "nettoContent"
  • Content unit: Measurement unit of the net content (e.g. g, kg, ml, l)
  • Base price reference quantity: Numeric reference amount stored in field "basePriceContent"
  • Base price unit: Measurement unit of the base price reference quantity

Example

  • Product price: 3.75 €
  • Net content: 750 ml
  • Base price reference: 1 l
  • Resulting base price: 5.00 € per 1 l

Fluid usage

<f:if condition="{product.basePriceAsFloat}">
    <small class="{settings.detail.css.class.infos.price.basePrice}">
        <f:render partial="Price" arguments="{settings: settings, price: product.basePriceAsFloat}"/> <f:translate key="tx_shop_label.base_price_per" /> {product.basePriceUnitArray.label}
    </small>
</f:if>

Notes

  • Base prices are only calculated if both the net content and the base price reference (including units) are set and valid.
  • The calculation always uses the current product price after discounts.
  • Rounding follows standard business rounding to 2 decimals.

Examples

Example data table

labelshortfactorAnmerkung/Faktor-Basis
Milliliterml1Flüssigkeiten: Basis ist 1 ml
Literl10001 l = 1000 ml
Milligrammmg1Trockengewicht: Basis ist 1 mg
Grammg10001 g = 1000 mg
Kilogrammkg10000001 kg = 1000 g = 1 000 000 mg
StückStk1Zählbare Einheiten, Basis ist 1 Stück
Zentimetercm1Länge: Basis ist 1 cm
Meterm1001 m = 100 cm
Quadratmeter10000Fläche: Basis ist 1 cm², 1 m² = 100 cm × 100 cm = 10 000 cm²
Kubikmeter1000000Volumen: Basis ist 1 cm³, 1 m³ = 100 cm × 100 cm × 100 cm = 1 000 000 cm³

Example SQL inserts

INSERT INTO tx_shop_domain_model_productmeasurement
(pid, label, short, factor, tstamp, crdate, cruser_id, deleted, hidden)
VALUES
    (0, 'Milliliter', 'ml', 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 0, 0),
    (0, 'Liter', 'l', 1000, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 0, 0),
    (0, 'Milligramm', 'mg', 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 0, 0),
    (0, 'Gramm', 'g', 1000, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 0, 0),
    (0, 'Kilogramm', 'kg', 1000000, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 0, 0),
    (0, 'Stück', 'Stk', 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 0, 0),
    (0, 'Zentimeter', 'cm', 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 0, 0),
    (0, 'Meter', 'm', 100, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 0, 0),
    (0, 'Quadratmeter', 'm²', 10000, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 0, 0),
    (0, 'Kubikmeter', 'm³', 1000000, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 0, 0);

Contact request

You can contact us at any time

Stop! Playing in the meantime?
Stop! Playing in the meantime?
Stop! Playing in the meantime?

Stop! Playing in the meantime?

Break the highscore

Press Start
Contact request
Screenreader label
Security question
I___________AOR______
H_T____Q____5_J___DB1
AWB___BEJ___ZIY______
__P____C______J___94I
__S_________WRT______