Developer forum

Forum » Ecommerce - Standard features » Make country not available in specific language

Make country not available in specific language

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

In 9.10 and before I could make a country not available as a shipping / billing country for a specific language at checkout simply by not translating it. So I could have 4 countries but translate, say, only Denmark in Danish. Then in checkout, all I would see is Denmark because the others aren't translated.

Now in 9.12 it seems that all content is always available and all countries appear as translated.. So how do implement the above scenario to hide countries other than Danmark? I tried the Delete button but after the delocalization warning that no longer deletes the translation and simply reloads the list.

Ideas?

Imar


Replies

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply
This post has been marked as an answer

Hi Imar

It's behavior defines by 1072 on DW9.12. It says "Countries should always be available to any language regardless of existing translations." So, backend now allows to defaine new name of a country in translated language. If you perform delete the translation then it returns back to value form default language. Per the feature, yup, currently 'Country' loop renders list of all items and not only translated as before. But you can use Ecom:CountryText.LanguageID tag inside 'CountryText' sub-loop says about language the coutry is defined in fact to limit the country list according context language. It's extra codding. Perhaps, it's workaround only now and your case is valid feature request to define new tag type of 'Boolean' will say about translation or render only translated countries according to context language in Country loop. Please, add the request if relevant. 

BR, Oleg QA  

 

Votes for this answer: 1
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Thanks Oleg, we'll consider our options...

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

I have run into this again, and wonder what the correct procedure is nowadays. I have a site with different languages (and target audience). On the Danish site, customers should only be able select Denmark as the ship-to country. Same for the German site where only Germany should be the allowed country.

Currently I see both countries on both sites.

Would it be an option to add a feature to the cart module to select which countries are supported similar to how we select shipping and payment providers? I could customize a template now, but that means more code changes when more countries are added.

Thanks!

Imar

 
Anders Ebdrup
Anders Ebdrup
Reply

Hi Imar,

 

I am very much looking for the same feature!

 

Best regards, Anders

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

+1

Adrian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Usually if you have only one country for a site, you remove the country selector from the checkout flow and use the default country for a website.

This is how many big websites do - and you remove complexity (fields) from the checkout flow helping increase conversions.

By enabling address formats on countries, you can remove country without coding using Swift.

Short term solution is to mark the selec as readonly or add a conditional to only add the current website delivery country to the country select.

Longer term it would be a setting on the cart paragraph to limit the available countries like you can do with shipping and payment.

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

>> Short term solution is to mark the selec as readonly or add a conditional to only add the current website delivery country to the country select.

Yeah, I was thinking of doing something like GetLoop("Countries").Where(x => x.GetString("Name") = GetGlobalValue("Global:Area.Culture.DisplayCountryName"))

to limit the list to the single country defined on the web site.

>> By enabling address formats on countries, you can remove country without coding using Swift.

Can you elaborate on that? I tried removing {country} from the edit address format but it had no effect in the frontend (Swift 1.22)

Thanks!

Imar

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Think I just found it on Github in templates after the 1.22 release so that explains why I am not seeing it on my soluiton.

 

You must be logged in to post in the forum