Upgrading your webshop
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
- Create the other currencies (Creating a new currency) and update the rates.
- Press Update autoprices so that products get prices in them.
- 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).
- Clear the content caches.
Contributors
- Svitlana Shatokhina
- Geir Arne Waaler
- Graham Brookins Updated Maintainer
Comments
Add a comment