SaaS CMS has officially launched! Learn more now.

Binh Nguyen Thi
Apr 4, 2019
  1663
(4 votes)

Workaround for supporting multilingual promotion

Did you use to be bored with old marketing system? The performance when running the old promotion engine or customizing a promotion used to be a big problem. But since the new marketing system was launched, the hard time has been ended.

But one good day, you have a customer request that we need to show our promotion name/description in the front view by multiple different languages. For example: there are 2 available languages in our site are English and Sweden.

How to do that?

We are aware that we could not do that with OOTB's Episerver until now. Although discount data has already been based on IContent but it has some limitations compared to other Episerver content like pages, blocks or catalog contents.

So is there any way to workaround with this requirement?

The answer here is YES but it is not simple way. Here is my way:

1. Install package EPiServer.VisitorGroupsCriteriaPack. We will use SelectedLanguage criterion for filtering promotions based on the current language

2. Setup 2 visitor groups for English and Sweden

3. Create 2 different campaigns for these two languages and appropriated promotions in these campaigns

4. Modiy MarketContentLoader class in QuickSilver sample code a bit to see proper promotions based on the current language in the home page: Using CampaignVisitorGroupFilter to filter campaign based on visitor group

 private readonly CampaignVisitorGroupFilter _campaignVisitorGroupFilter;
public virtual IList<PromotionData> GetEvaluablePromotionsInPriorityOrderForMarket(IMarket market)
{
   var result = _campaignVisitorGroupFilter.Filter(
                new PromotionFilterContext(GetPromotions().Where(x => IsValid(x, market)),
                    RequestFulfillmentStatus.All));
   return result.IncludedPromotions.OrderBy(x => x.Priority).ToList();
}

5. Finally, let's see the result in the front view

  • In English

  • In Sweden

Apr 04, 2019

Comments

Please login to comment.
Latest blogs
Optimizely SaaS CMS Concepts and Terminologies

Whether you're a new user of Optimizely CMS or a veteran who have been through the evolution of it, the SaaS CMS is bringing some new concepts and...

Patrick Lam | Jul 15, 2024

How to have a link plugin with extra link id attribute in TinyMce

Introduce Optimizely CMS Editing is using TinyMce for editing rich-text content. We need to use this control a lot in CMS site for kind of WYSWYG...

Binh Nguyen Thi | Jul 13, 2024

Create your first demo site with Optimizely SaaS/Visual Builder

Hello everyone, We are very excited about the launch of our SaaS CMS and the new Visual Builder that comes with it. Since it is the first time you'...

Patrick Lam | Jul 11, 2024

Integrate a CMP workflow step with CMS

As you might know Optimizely has an integration where you can create and edit pages in the CMS directly from the CMP. One of the benefits of this i...

Marcus Hoffmann | Jul 10, 2024

GetNextSegment with empty Remaining causing fuzzes

Optimizely CMS offers you to create partial routers. This concept allows you display content differently depending on the routed content in the URL...

David Drouin-Prince | Jul 8, 2024 | Syndicated blog

Product Listing Page - using Graph

Optimizely Graph makes it possible to query your data in an advanced way, by using GraphQL. Querying data, using facets and search phrases, is very...

Jonas Bergqvist | Jul 5, 2024