From ac16374316317e3404920364fe9275d520911d72 Mon Sep 17 00:00:00 2001 From: Mariia Lukianets Date: Mon, 8 Jan 2024 14:19:59 +0100 Subject: [PATCH 1/2] Create merch block README.md --- libs/blocks/merch/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 libs/blocks/merch/README.md diff --git a/libs/blocks/merch/README.md b/libs/blocks/merch/README.md new file mode 100644 index 0000000000..f87c4744e2 --- /dev/null +++ b/libs/blocks/merch/README.md @@ -0,0 +1,25 @@ +# Commerce Settings + +## WCS Locale +To check which locale was used to render the price/CTA: +* In the network tab search for a 'wcs' request, e.g. +https://wcs.adobe.com/web_commerce_artifact?offer_selector_ids=PpnQ-UmW9NBwZwXlFw79zw2JybhvwIUwMTDYiIlu5qI&country=DE&language=MULT&locale=de_DE&api_key=wcms-commerce-ims-ro-user-milo&landscape=PUBLISHED +* The 'country' parameter decides the format and exact price + +### Where does the WCS 'country' parameter come from? +* Check the 'lang' parameter value on your page (it's set on tag) +* If the value is special, e.g. 'africa', Commerce(tacocat) will do the mapping: +const GeoMap = { + africa: 'en-ZA', + mena_en: 'en-DZ', + il_he: 'iw-IL', + mena_ar: 'ar-DZ', + id_id: 'in-ID', + no: 'nb-NO', +}; +* If the value is in format 'xx-YY' (case doesn't matter), for example 'en-GB', Commerce will split it in the 'xx' becoming a language and 'YY' a country. +* If the value is in format 'xx', language only, e.g. 'hi', Commerce will set language to hindi, but fetch US prices, as US is a default value for country +* In there is no value set, 'en' language and 'US' country is used + +### Where does the 'lang' value come from? +scripts.js file, see 'locales' object, 'ietf' value. From 26603de3be8c104af3ec439270169cd813ffee5a Mon Sep 17 00:00:00 2001 From: Mariia Lukianets Date: Mon, 8 Jan 2024 16:14:31 +0100 Subject: [PATCH 2/2] fix code styling --- libs/blocks/merch/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/blocks/merch/README.md b/libs/blocks/merch/README.md index f87c4744e2..5d0a7f256c 100644 --- a/libs/blocks/merch/README.md +++ b/libs/blocks/merch/README.md @@ -8,7 +8,8 @@ https://wcs.adobe.com/web_commerce_artifact?offer_selector_ids=PpnQ-UmW9NBwZwXlF ### Where does the WCS 'country' parameter come from? * Check the 'lang' parameter value on your page (it's set on tag) -* If the value is special, e.g. 'africa', Commerce(tacocat) will do the mapping: +* If the value is special, e.g. 'africa', Commerce(tacocat) will do the mapping. Below is an example of GeoMap, for the latest visit [tacocat project](https://git.corp.adobe.com/wcms/tacocat.js) +``` const GeoMap = { africa: 'en-ZA', mena_en: 'en-DZ', @@ -16,7 +17,11 @@ const GeoMap = { mena_ar: 'ar-DZ', id_id: 'in-ID', no: 'nb-NO', + cis_en: 'en-AZ', + cis_ru: 'ru-AZ', + SEA: 'en-SG', }; +``` * If the value is in format 'xx-YY' (case doesn't matter), for example 'en-GB', Commerce will split it in the 'xx' becoming a language and 'YY' a country. * If the value is in format 'xx', language only, e.g. 'hi', Commerce will set language to hindi, but fetch US prices, as US is a default value for country * In there is no value set, 'en' language and 'US' country is used