We fixed the problem with currency conversion
The Electric Mojo Guitars online store stocks electric guitar hardware and accessories from over 100 brands. The office and showroom are located in Quebec, Canada. A distinctive feature of the company is fast delivery, which takes 1-2 days to Canada and the USA and 3-5 days to anywhere in the world.
The main turnover of the client occurs with buyers from the USA, Canada and the EU. Item and shipping charges are billed respectively in US dollars, Canadian dollars, euros and pounds sterling. When the buyer was choosing to pay, for example, in euros, fractional parts of numbers were lost when converting to the base currency set in CS-Cart and vice versa. This is a general arithmetic floating point problem. The situation was aggravated by the fact that payment systems did not accept data with counting errors, and payments for products became impossible.
It was necessary to correct the error: the order total in all currencies must have been correct up to the last decimal place.
By default, payments in CS-Cart are carried out in one currency, which is set by the administrator. It’s called base store currency. You can choose other currencies that are convenient for the buyer to display the price of products on the storefront. When paying for an order, the storefront currency will be converted into the base currency automatically at the exchange rate set in the admin area.
Electric Mojo Guitars has buyers from Canada, the USA and the EU who are comfortable paying in the currencies of their countries. Therefore, Electric Mojo Guitars’ payment system is configured to accept payments not only in the base currency, but also in other currencies. The total cost of the order in this case is also calculated depending on the exchange rate.
In order not to lose a single “penny” when converting the order value into the base currency, we decided to tie it to the choice of currency, but at the same time untie it from the exchange rate. That is, now there is no conversion of currencies into the base one at all. The administrator manually sets the cost of the product and delivery for each product in four currencies: US dollars, Canadian dollars, euros and pounds sterling. The prices are fixed and are not convertible to and from the base currency. Accordingly, there is no calculation error.
This is how the form that we added when editing the product looks like.
It seems that such a solution requires extra work from the administrator. If the cost of delivery or products in any of the currencies changes, he will have to go into editing the goods and manually correct everything. And what happens if there are hundreds of such products?
In fact, everything is easier and more convenient after the changes we applied. Electric Mojo Guitars has an agreement with manufacturers on to what countries the products can be sold at what price. Therefore, if the price changes, then it is changed by the manufacturer, and not at the request of Electric Mojo Guitars or based on the exchange rate. This means that all prices in CS-Cart can be automatically updated through import by simply uploading a file with new data from the manufacturer.
The buyer can pay for the products in any of four available currencies. Errors in currency conversion are excluded.
Share your idea and we’ll offer an optimal solution