The website is working with two currencies - GBP (base currency) and EUR. For countries in the UK the shipping should be 5 GBP, for the rest it should be exactly 6 EUR (for example 4.71 GBP in base currency).
I've created an observer which detects the country and changes the shipping rate but there are problems with it for the orders placed from the backend.
My idea is to dispatch a custom event when the currency rates are changed (after_save). This is easy. To recalculate the value for the other countries to be 6 EUR is easy too - it would be 6/currentlySavedGbpToEurCrrencyRate
. For example 4.71 GBP.
But how can I edit the currently saved shipping rates which were imported with the CSV file? I have to update them. Can I somehow create a new csv file programatically and call Mage_Shipping_Model_Resource_Carrier_Tablerate::uploadAndImport
?
Another option is to edit the values in the DB directly - table shipping_tablerate
. Is it safe?
Note: I know that the best solution would be creating a second website with base currency EUR but this is not possible at the moment, so I'm searching a workaround.