CONTINUED FROM ABOVE POST DUE TO FORUM POST SIZE RESTRICTIONS.
The Patch file in this zip file (
Attachment 708) will do the below automatically for you.
Modify the table xcart_currencies by adding a field called 'rate', setting it as 'double' and making sure the default value is set to zero.
Code:
ALTER TABLE `xcart_currencies` ADD `rate` double NOT NULL default '0'
Modify the table xcart_config by adding entries including your default currency eg:
Code:
INSERT INTO `xcart_config` VALUES ('currency_rate_GBP', 'Rate for the British Pound', '1', 'Multiple_Currency', 10, 'numeric', '1.0', '');
INSERT INTO `xcart_config` VALUES ('currency_rate_EUR', 'Rate for the EURO', '1.35572', 'Multiple_Currency', 20, 'numeric', '1.0', '');
INSERT INTO `xcart_config` VALUES ('currency_rate_USD', 'Rate for the US Dollar', '1.99779', 'Multiple_Currency', 30, 'numeric', '1.0', '');
INSERT INTO `xcart_config` VALUES ('currency_rate_CAD', 'Rate for the Canadian Dollar', '1.95798', 'Multiple_Currency', 40, 'numeric', '1.0', '');
INSERT INTO `xcart_config` VALUES ('currency_rate_AUD', 'Rate for the Australian Dollar', '2.27001', 'Multiple_Currency', 50, 'numeric', '1.0', '');
INSERT INTO `xcart_config` VALUES ('currency_rate_HKD', 'Rate for the Hong Kong Dollar', '15.5755', 'Multiple_Currency', 60, 'numeric', '1.0', '');
If you need to delete a currency i.e. you no longer want to show that currency you can run this code in your patch / upgrade section for the code you want to delete, for example HKD:
Code:
DELETE FROM xcart_config WHERE name='currency_rate_HKD';
The above will delete the Hong Kong Dollar RATE ONLY.
You need to run these SQL commands:
Code:
INSERT INTO `xcart_languages` VALUES ('US', 'lbl_currencies', 'Currencies', 'Labels');
INSERT INTO `xcart_languages` VALUES ('US', 'option_title_Multiple_Currency', 'Multiple Currencies Options', 'Labels');
INSERT INTO `xcart_modules` (module_name,module_descr,active) VALUES ('Multiple_Currency', 'Enables users to select different currencies to be displayed.', 'Y')
THE FULL PATCH FILE CODE THATS INCLUDED IN THE ATTACHEMENT AND ABOVE
Code:
ALTER TABLE `xcart_currencies` ADD `rate` double NOT NULL default '0';
INSERT INTO `xcart_config` VALUES ('currency_rate_GBP', 'Rate for the British Pound', '1', 'Multiple_Currency', 10, 'numeric', '1.0', '');
INSERT INTO `xcart_config` VALUES ('currency_rate_EUR','Rate for the EURO', '1.35572', 'Multiple_Currency', 20, 'numeric', '1.0', '');
INSERT INTO `xcart_config` VALUES ('currency_rate_USD', 'Rate for the US Dollar', '1.99779', 'Multiple_Currency', 30, 'numeric', '1.0', '');
INSERT INTO `xcart_config` VALUES ('currency_rate_CAD', 'Rate for the Canadian Dollar', '1.95798', 'Multiple_Currency', 40, 'numeric', '1.0', '');
INSERT INTO `xcart_config` VALUES ('currency_rate_AUD', 'Rate for the Australian Dollar', '2.27001', 'Multiple_Currency', 50, 'numeric', '1.0', '');
INSERT INTO `xcart_config` VALUES ('currency_rate_HKD', 'Rate for the Hong Kong Dollar', '15.5755', 'Multiple_Currency', 60, 'numeric', '1.0', '');
INSERT INTO `xcart_languages` VALUES ('US', 'lbl_currencies', 'Currencies', 'Labels');
INSERT INTO `xcart_languages` VALUES ('US', 'option_title_Multiple_Currency', 'Multiple Currencies Options', 'Labels');
INSERT INTO `xcart_modules` (module_name,module_descr,active) VALUES ('Multiple_Currency', 'Enables users to select different currencies to be displayed.', 'Y');
UPDATE xcart_currencies SET symbol='CAD $' WHERE CODE='CAD';
UPDATE xcart_currencies SET symbol='HKD $' WHERE CODE='HKD';
UPDATE xcart_currencies SET symbol='AUD $' WHERE CODE='AUD';
I wanted to show that AUD $ and CAD $ and HKD $ was not the same as USD $ so the 3 above update patches is to change the symbol from $ too ??? $
Go into the Admin > Modules area. 'Multiple_Currency' should be listed and ticked.
Click 'Configure' to set your exchange rates, your default currency in this case GBP should be set to 1.
The above files have been tested at
http://www.shishapipe.net/shopcart/home.php (Because of the way the site is designed I do not use the skin1/customer/top_menu.tpl so I placed my code in the head.tpl)