Automatic calculation of gross / net product prices

When creating or editing a product in the backend, prices (gross price using net and VAT or net price using gross and VAT) are calculated automatically. Use the symfony command shop: computeProductPrices to recalculate product prices.

Arguments

The symfony command shop:computeProductPrices is called using two arguments:

  • pageUid the page ID where the product entries are stored.
  • direction calculation path. The argument can take 2 possible values:
    • net: Calculates net prices from gross prices and VAT
    • gross: Calculates gross prices from net prices and VAT

Call

The Symfony command can be called in 2 ways:

  1. Call in TYPO3 scheduler:
    • In the Scheduler backend module click on Add Task (the + symbol)
    • In the Class selectbox select the Execute Console commands class
    • Select Single in the Type selectbox
    • Select shop:computeProductPrices in the Schedulable Command selectbox
    • Click on the Save button
    • Fill out the argument fields and save the scheduler task again
    • Now you can execute the command as a task in the scheduler module
  2. Call in the console:
    • ./vendor/bin/typo3 shop:computeProductPrices <pageUid> <direction>
    • Example: ./vendor/bin/typo3 shop:computeProductPrices 2 gross