cancel
Showing results for 
Search instead for 
Did you mean: 

SmartEdit for 1 shop with multiple base stores each with difference product catalog

relsayed8205
Explorer
0 Kudos

Hello,

I have a WCMS site with 4 base stores, each having a different product catalog. I have also logic that lets the user select which base store he wants to see. Selecting a base store sets the related catalog version in session, using

DefaultCMSSiteService.setCurrentCatalogVersion.

This works well, but not in SmartEdit. The CMSSiteFilter calls the method getContextInformationLoader().initializePreviewRequest with every request. This gets the default product catalog of the WCMS site and set its active version in session, overriding my logic above. Therefore, I can not open the PDP in smartedit as a wrong catalog version is referenced.

I wonder why smartedit does not support such a standard scenario of having multiple base stores, eahc with different product catalog!

Any idea how to solve this? BTW, I am on SAP Commerce 2011

Best regards

Rasha

Accepted Solutions (1)

Accepted Solutions (1)

relsayed8205
Explorer
0 Kudos

It turns out, that smart edit code does not consider the case of having multiple base stores per site and a product catalog per base store. The workaround I implemented is the following:

Disable the ActiveBaseSitePreviewStrategy.

Explanation: The method getContextInformationLoader().initializePreviewRequest calls 3 strategies to initialize the preview request. The above is one of them. It sets in the session the active site together with other things, among which is the default catalog version.

We want only to set the active site. This and also the other things set by this strategy, they are set in other places in the code. So this strategy is not necessary.

So in a custom extension xxx-spring.xml add the following

<alias name="defaultPreviewRequestStrategiesList" alias="previewRequestStrategiesList" />
<util:list id="defaultPreviewRequestStrategiesList">
    <ref bean="catalogVersionsPreviewStrategy" />
    <ref bean="uiExperienceLevelPreviewStrategy" />
</util:list>

defaultPreviewRequestStrategiesList represents the list of strategies injected in ContextInformationLoader (see acceleratorcms-spring). I just removed ActiveBaseSitePreviewStrategy from it.

Answers (1)

Answers (1)

samuelyang
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Rasha,

I didn't try this setup on my end, but sounds like a limitation.

You know a base store can also have multiple product catalogs, is it possible to workaround the issue by only having one base store for the cms site and adding multiple catalogs to that base store?

relsayed8205
Explorer
0 Kudos

Hello Samuel, thanks for your reply. This does not solve my problem because, as mentioned, always the default catalog in the site is considered. Additionally, It does not fit my business case to have one base store.