b_vassy Posted March 17, 2007 Posted March 17, 2007 First of all, let me say Hello to everyone since it's my first post and to give a big thanks to all that worked and contributed to oscommerce. Now, this is my problem: I get a list of products from my suppliers with prices in different currencies (USD and EURO). Some products (most of them) have their prices listed in USD and some of the products have their prices listed in EURO. I can easily convert the prices to USD and insert the products in my catalogue, but the problem is the exchange rate. If i convert the prices from EURO to USD today, tommorow the exchange rate will be another one, and my prices won't refflect this. I know my english is quite bad, so let me give you an example: In the list from my suppliers, i have product X with the price of 100 EURO. When i insert this product in my oscommerce catalogue, i manually calculate (based on the exchange rate from that day) that 1 EURO = 1.29 USD. So i set the price at 129 USD. But the next day the exchange rate modifies and 1 EURO = 1.32 USD. So i have to manually modify every product that i have in my catalogue with the price set at the old exchange rate. I will have many products and I can't do this every day. And if i don't do it, either I or the buyer will have to pay the difference. I tried but couldn't find a contribution or a thread that had something to do with this. I know some php/mysql so i looked and from what i could see the easiest way is to add a Currency field in the Products table with the values EURO and USD. And modify the currencies function so that when the currency is EURO to calculate the exchange rate and display the price in USD. But i have no idea how to do this :( Can someone help me? Or can you tell me another way to do this? Thank you
zhexiang Posted March 18, 2007 Posted March 18, 2007 How come you have to change the price for every products? I thought you could have done it easily on admin site? If i'm not mistaken, there's a module where you can set the forex for currency. Just look for module > currency. You should have one for US dollar and one for Euro Dollar... I know for US dollar it's set to 1, for the Euro just change it to the new number for a new day...
b_vassy Posted March 18, 2007 Author Posted March 18, 2007 How come you have to change the price for every products?I thought you could have done it easily on admin site? If i'm not mistaken, there's a module where you can set the forex for currency. Just look for module > currency. You should have one for US dollar and one for Euro Dollar... I know for US dollar it's set to 1, for the Euro just change it to the new number for a new day... Hi, My problem is that i receive a list of prices both in EURO and USD. And in the admin section i can only enter prices in the default currency, wich is USD in my case. So i have to manually convert the prices from EURO to USD when i insert the products. What i'm looking for is a way to be able to enter products prices either in USD or EURO, so i don't have to convert them myself. So, when i add a new product, i will have a dropdown before the price box, where i can choose the currency. Or something like this. And i couldn't find anything that does this :(
Guest Posted March 18, 2007 Posted March 18, 2007 Hi, My problem is that i receive a list of prices both in EURO and USD. And in the admin section i can only enter prices in the default currency, wich is USD in my case. So i have to manually convert the prices from EURO to USD when i insert the products. What i'm looking for is a way to be able to enter products prices either in USD or EURO, so i don't have to convert them myself. So, when i add a new product, i will have a dropdown before the price box, where i can choose the currency. Or something like this. And i couldn't find anything that does this :( You would have to modify your categories.php to store a different currency with each product and then also the currency class. And say you do all these. What happens when the customer checks out? How you're planning to handle the payment gateways. Somehow you need to convert the product prices to the same currency to get the right results.
vasttech Posted March 18, 2007 Posted March 18, 2007 If I understand this correctly, and all you are looking to do is have a drop down in the admin section where you enter the price that says EURO or USD (similar to the way the Tax/No Tax dropdown works) and have the price converted automatically you could do it with a little javascript on the categories.php file in the admin section. If you do it this way you would obviously only be storing USD in the database. Now if you wanted it to store both the USD and EURO price in the database it will require a little more work and thought process as Enigma said. But if you just want a quick convert right there on the screen you could create an input box where you enter the price, then a dropdown that says EURO/USD, create another input box that is set to store the value, and set the onChange value for the dropdown to run a javascript that converts the amount entered in the first box on the fly and sets it in the second input box. You could pull the conversion rate from the database by incorporating php into the javascript so that you can set the conversion rate daily. Hope that made sense, it has been a long day. :) osCommerce Knowledge Base osCommerce Documentation Contributions
b_vassy Posted March 18, 2007 Author Posted March 18, 2007 You would have to modify your categories.php to store a different currency with each product and then also the currency class. And say you do all these. What happens when the customer checks out? How you're planning to handle the payment gateways. Somehow you need to convert the product prices to the same currency to get the right results. Yes, you're right. I never thought about this. This is even harder then i initially thought it would be :( I think i'm gonna drop everything and just use USD for all my prices. But i'm sure i'm not the only one with this problem. Maybe there is a solution afterall. Anyway, if you think of something, please let me know. And i'll do the same. Thank you
b_vassy Posted March 18, 2007 Author Posted March 18, 2007 If I understand this correctly, and all you are looking to do is have a drop down in the admin section where you enter the price that says EURO or USD (similar to the way the Tax/No Tax dropdown works) and have the price converted automatically you could do it with a little javascript on the categories.php file in the admin section. If you do it this way you would obviously only be storing USD in the database. Now if you wanted it to store both the USD and EURO price in the database it will require a little more work and thought process as Enigma said. But if you just want a quick convert right there on the screen you could create an input box where you enter the price, then a dropdown that says EURO/USD, create another input box that is set to store the value, and set the onChange value for the dropdown to run a javascript that converts the amount entered in the first box on the fly and sets it in the second input box. You could pull the conversion rate from the database by incorporating php into the javascript so that you can set the conversion rate daily. Hope that made sense, it has been a long day. :) Thanks for your answer vasttech, but i'm not looking only for a drop down. Because this won't solve my problem with the exchange rate. But it did make sense :P I'm talking with my brother about this and he suggested something. I can make 2 radio buttons in categories.php so when i insert a new product i can check the box for EURO or USD. I insert all my prices in USD, but for the products that i receive their prices in EURO, i check the box with the value EURO. I add a new field in my products table where i mark the products that have the box for EURO checked. And i make a new page where i can modify the prices for all the products that have the EURO box checked. If today EURO droped 1% i simply enter this on this page and it modifies all the prices for this products. This way, i only have to do this once every day, instead of manually modifing all the products. And it solves the problem that enigma1 mentioned, because all the prices in the database are in USD. Of course, this means that i should keep a log of how the exchange rate fluctuates every day :D And it still looks like an amateur job, but i have no other idea at the moment :(
florinfs Posted March 30, 2011 Posted March 30, 2011 Hi b_vassy, I'm having the same problem, did you manage to find a solution for this? Thanks
Recommended Posts
Archived
This topic is now archived and is closed to further replies.