Skip to the content
Documentation

Upgrading your webshop

No ratings yet

A shop whose products use the Price datatype can move to multi-currency prices with one console command. It converts the Price attributes of every class that has one into Multi-price attributes, and each product's price into a custom price.

Before you start

  • Back up the database. The command runs in one transaction, but it changes classes and every product.
  • The prices become custom prices in the currency of the site's locale (site.ini [RegionalSettings] Locale). When that currency is not in the currency list, the command creates it.

Run it

./console exp:convertprice2multiprice --allow-root-user
# the same script
php bin/php/convertprice2multiprice.php

It prints each class it converts and a dot per object. A class without objects is reported and skipped.

Afterwards

  1. Create the other currencies (Creating a new currency) and update the rates.
  2. Press Update autoprices so that products get prices in them.
  3. Check templates that read the price attribute: Multi-price has the same inc_vat_price and ex_vat_price, plus the price lists (see Multi-price products).
  4. Clear the content caches.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.