Multi-Country Site in hybris

Multi-Country Site Overview


Multi-country site is a very good feature supported in Hybris

This feature should be used when we have below requirement

Developing ecommerce site for multiple countries
Each country will have its custom content
All the countries share some common content

The above requirement can be achieved easily using multi-country site support provided by Hybris

How this feature works ?


We need to create hierarchy of content catalog to solve above requirement using Multi-country feature

We need to have one global content catalog which will have all the common WCMS components like page templates,content slots etc.

We need to create country/region specific content catalog for each country/region which will have country/region specific WCMS components

We need to maintain the inheritance of these content catalogs by making most generic global catalog as Parent catalog and most specific country catalog as Child catalog.

In this way, we can share the common content across each country by defining common content in global catalog and by overriding country specific content within the Country specific catalog.

Multicountry_Site

We have a site called “MySite” which supports 2 countries USA and UK.

We have defined common WCMS components between USA and UK in global content catalog

We can define US specific content catalog changes in MySiteUSContentCatalog

We can define UK specific content catalog changes in MySiteUKContentCatalog

How Hybris gets the required WCMS component from catalog hierarchy?


When we have Single content catalog for a site, its very easy for Hybris to load the content just by using that content catalog associated to Site.
But in this case, we have hierarchy of content catalogs associated to a site

When Hybris loads the storefront pages, first it tries to get the content in the lowest content catalog in the hierarchy and then traverses the catalog tree upward until the targeted content is found.

Example:
In the above example,When homepage of US site is loading, it first checks for homepage within MySiteUSContentCatalog
If we have defined custom homepage within this catalog then custom homepage will be loaded, if we have not defined it then it goes to its immediate parent content catalog which is MySiteGlobalContentCatalog and homepage defined in this global catalog will be displayed.


Key takeaways

1) Multi-Country Site feature allows us to set up a consistent look and feel across all the websites while making it possible to customize content catalogs for different regions and languages.

2) For Multi-Country Site Support, we should associate each content catalog to its parent content catalog as per requirement.

3) This feature should be used when we need to share common content across different sites but providing flexibility to each country to customize the content

4) This feature makes the best reuse of global content rather than redefining the same for each country or region.

5) The child content catalog version can inherit content from all of the parent content catalogs

About the Author

Karibasappa G C (KB)
Founder of javainsimpleway.com
I love Java and open source technologies and very much passionate about software development.
I like to share my knowledge with others especially on technology 🙂
I have given all the examples as simple as possible to understand for the beginners.
All the code posted on my blog is developed,compiled and tested in my development environment.
If you find any mistakes or bugs, Please drop an email to kb.knowledge.sharing@gmail.com

Connect with me on Facebook for more updates

Share this article on