-
Notifications
You must be signed in to change notification settings - Fork 0
LiteCommerce module: custom currency symbol
Right now LiteCommerce uses currency codes as currency symbols when displaying prices in the store front. Later there will be a back-end function to manage currency symbols, but for now you can specify you custom currency symbols as follows:
The easiest way is to alter the currency symbol in the database:
UPDATE xlite_currencies SET symbol = '$' WHERE code = 'AUD';
This will work and will likely be compatible with future LiteCommerce updates.
Another solution is developing a custom module that replaces the symbol:
-
Create a blank LiteCommerce module beneath the directory where your shop is installed.
-
Create the "classes/XLite/Module/<your developer ID>/<your module ID>/Model/Currency.php" file. Edit it as follows:
<?php namespace XLite\Module\<your developer ID>\<your module ID>\Model; /** * Currency * * @since 1.0.7 */ class Currency extends \XLite\Model\Currency implements \XLite\Base\IDecorator { /** * Return the currency symbol * * @return string */ public function getSymbol() { return ($this->getCode() == 'AUD') ? '$' : parent::getSymbol(); } }
-
Re-build the LiteCommerce classes cache (the shop back-end -> "Maintenance" tab -> "Re-Build cache" page) to get the new module listed among other modules on the "Manage add-ons" page (the shop back-end -> "Add-ons" tab -> "Manage add-ons" page). Enable the module on this page (this will re-build the cache once again).