im trying to setup a tea commerce solution using the tea commerce starter kit v3.2.0, my customer wants to be able to sell in 3 countries UK, DA, FR my issue is i cant seem to work around how the best practise is for handling currency, it seems to use the default currency selected in the shop selected in the store selection.
the site is set so if the user goes to example mystoreexample.dk it redirects to mystoreexample.com/da and so on with all countries. but if im in the DA section it should show prices in danish krones all over the site and use danish vat and if the user is on the mystoreexample.com/fr shop it should show all prices in euro. i have created all vats and currencys in the store section of the tea commerce section but how to let it be used like i want instead of having EURO as currency for all countries? any way to do it in tea commerce or does any one have a solution for it?
You should set up the countries in the Tea Commerce settings and on each country you should se a default currency.
On each currency you need to chose which countries that currency should be available in. If you only set DKK to available in Denmark, franc's in france and so on, you can now change the country and the currency will change with it.
Now set up a small razor macro that will change the country automatically on every page load depending on where the user is on your site. Remember this must happen in the
ANOTHER solution, is to set up the razor macro to change the currency on each page load. In that case you will probably need to set up the currencies to be available in all countries, as you might give the customer the opportunity to change country later in the cart.
Remember that countries and Umbraco languages are two completely different things.
I have set up countris in the TC settings and set default currency, and made the different currency available for the countries they should be available in, havent made macro yet but when i change the country on the site currency still dosn't change, will it first start to change when i have embedded a macro that change the currency on each page load?
Could you send a screenshot of your setup of your currencies - especially the "Available in" tab. If your currency is only allowed in lets say Denmark and you have a USD currency that is only allowed in United States. Then when you change your country from Denmark to United States - your currency for your order should change as well.
If you use the starter kit try and change the payment country in the dropdown in step 2 of the cart. That should change the currency when you go to step 3
yep that changes the currency, ty s i just need to add that feature to pageload. =) ill just see if i can do that and if im getting it working ill mark your answer as the solution.
Okay so i made up a Razor file and made a macro thats uses it. i have to say this razor thing is pretty new to me. so from here in this razor file i make a page_load ? that change the country/currency ? and any hints on how?
The best way to learn Razor for Umbraco is using their tv platform: http://umbraco.tv/
To set the Country using the Razor API of Tea Commerce see this link: http://documentation.teacommerce.net/razor-api/country/setcurrentpaymentcountry/ You will have to run some code on every page load (happesn if its placed in a macro that renders everytime) and here you will change the country depending on which url the customer is using.
Atm i made this method. it stil fails on c in the foreach
@{
//Store id
long storeId = long.Parse( Model._Store );
IEnumerable<Country> countries = TC.GetCountries(storeId);
string cultureName = System.Threading.Thread.CurrentThread.CurrentCulture.Name;
foreach (Country c in countries)
{
if (cultureName == c.ToString())
{
//Found current culture and matching attribute culture...
Country country = TC.GetCurrentPaymentCountry(storeId);
}
Response.Write(@"<script language='javascript'>alert('" + c.ToString() + "');</script>");
}
}
so think im getting closer for the solution i hope =)
multilanguage/currency problem
Hello there
im trying to setup a tea commerce solution using the tea commerce starter kit v3.2.0, my customer wants to be able to sell in 3 countries UK, DA, FR my issue is i cant seem to work around how the best practise is for handling currency, it seems to use the default currency selected in the shop selected in the store selection.
the site is set so if the user goes to example mystoreexample.dk it redirects to mystoreexample.com/da and so on with all countries. but if im in the DA section it should show prices in danish krones all over the site and use danish vat and if the user is on the mystoreexample.com/fr shop it should show all prices in euro. i have created all vats and currencys in the store section of the tea commerce section but how to let it be used like i want instead of having EURO as currency for all countries? any way to do it in tea commerce or does any one have a solution for it?
Hi Tommy,
You should set up the countries in the Tea Commerce settings and on each country you should se a default currency.
On each currency you need to chose which countries that currency should be available in. If you only set DKK to available in Denmark, franc's in france and so on, you can now change the country and the currency will change with it.
Now set up a small razor macro that will change the country automatically on every page load depending on where the user is on your site. Remember this must happen in the
ANOTHER solution, is to set up the razor macro to change the currency on each page load. In that case you will probably need to set up the currencies to be available in all countries, as you might give the customer the opportunity to change country later in the cart.
Remember that countries and Umbraco languages are two completely different things.
/Rune
Hi Rune
I have set up countris in the TC settings and set default currency, and made the different currency available for the countries they should be available in, havent made macro yet but when i change the country on the site currency still dosn't change, will it first start to change when i have embedded a macro that change the currency on each page load?
Could you send a screenshot of your setup of your currencies - especially the "Available in" tab. If your currency is only allowed in lets say Denmark and you have a USD currency that is only allowed in United States. Then when you change your country from Denmark to United States - your currency for your order should change as well.
Kind regards
Anders
thats how it is setup inside TC settings.
That looks right. DO you use the Razor TC class to change the country?
im not sure how/where to set that up, if that isnt in the starter kit.
If you use the starter kit try and change the payment country in the dropdown in step 2 of the cart. That should change the currency when you go to step 3
yep that changes the currency, ty s i just need to add that feature to pageload. =) ill just see if i can do that and if im getting it working ill mark your answer as the solution.
Okay so i made up a Razor file and made a macro thats uses it. i have to say this razor thing is pretty new to me. so from here in this razor file i make a page_load ? that change the country/currency ? and any hints on how?
Hi Tommy
The best way to learn Razor for Umbraco is using their tv platform:
http://umbraco.tv/
To set the Country using the Razor API of Tea Commerce see this link:
http://documentation.teacommerce.net/razor-api/country/setcurrentpaymentcountry/
You will have to run some code on every page load (happesn if its placed in a macro that renders everytime) and here you will change the country depending on which url the customer is using.
Kind regards
Anders
Atm i made this method. it stil fails on
c
in the foreachso think im getting closer for the solution i hope =)
I made a solution that looks like this in a razor macro added to the masterpage
You could refactor to
Country country = TC.GetCountries(storeId).SingleOrDefault(c => c.RegionCode == cultureName);
if(country != null){
TC.SetCurrentPaymentCountry(storeId, country.Id);
}
Just a bit shorter :)
ty for that =)
is working on a reply...