Commerce

CMC Tool – Add Custom store feature

Introduction

Store feature is a concept of enabling feature which is developed by developers to specific stores in the extended site business model. OOB provides in built store features like enable solr search, BazaarVoice, analytics etc.. This post can help us to implement custom store features.

 

Step 1 : Run below quires to add an entry into EMSPOT and DMEMSPOTDEF

INSERT INTO EMSPOT (EMSPOT_ID,STOREENT_ID,NAME,DESCRIPTION,USAGETYPE) VALUES ((SELECT MAX(EMSPOT_ID)+1 FROM EMSPOT), (select STORE_ID from STORE where DIRECTORY = ‘<StoreFrontAssetStore>’),  ‘ <Store feature name>  ‘, ‘<Description of the Store Store feature>’, ‘STORESTORE FEATURE’);

INSERT INTO DMEMSPOTDEF (DMEMSPOTDEF_ID,EMSPOT_ID,STOREENT_ID,CONTENTTYPE,CONTENT,OPTCOUNTER) VALUES ((SELECT MAX (DMEMSPOTDEF_ID)+1 FROM DMEMSPOTDEF), (SELECT EMSPOT_ID FROM EMSPOT WHERE NAME=’ <Store feature name>’), (select storeent_id from storeent where identifier='<Store Identifier>’),’Store featureEnabled’,’true’,0);

UPDATE KEYS SET COUNTER = COUNTER + 1 WHERE TABLENAME = ’emspot’;

UPDATE KEYS SET COUNTER = COUNTER + 1 WHERE TABLENAME = ‘dmemspotdef’;

Step 2 : Add below entries into new properties file in LOBTools project src folder.

<Store feature name>.description= <Description of the store Store feature>

<Store feature name>.checkboxEnable.title=<Title of the store Store feature>

<Store feature name>.checkboxEnable.label=<Lable to display in MC tool>

Ex: <Store feature name>.description=Select this option to enable  Shopping conditions in the CheckOut.

Ex:<Store feature name>.checkboxEnable.title=Select this option to enable  Shopping conditions in the CheckOut.

Ex: <Store feature name>.checkboxEnable.label=Apply  Shopping conditions.

Step3: Import the newly added property from Resource Bundle:

  1. In the Enterprise Explorer view, navigate to LOBTools > WebContent > config > commerce > store > propertiesViews > <Store Folder>.
  2. Open StoreFlexFlowPropertiesView.def for editing.
  3. locate the following line of code:
    <ResourceBundle definitionName=”stoFlexFlow_10001″ baseName=”tools.stores.Madisons.devtools.flow.ui.config” />
  4. Append the following line of code:

<ResourceBundle definitionName=”stoFlexFlowExt_10151″ baseName=”com.telcel.commerce.store.client.lobtools.properties.StoreLOB” />

 

Step4: Add the new PropertyPane object definition:

Locate the following code snippet:

<PropertyPane definitionName=”stoStoreLocatorFlexFlow_10001″ >

<PropertyGroup name=”group” collapsable=”false” >

<PropertyStaticText text=”${stoFlexFlow_10001.StoreLocatorPanel.description}” />

<PropertyCheckbox name=”StoreLocator.checkbox” promptText=”${stoFlexFlow_10001.StoreLocator.checkbox.label}” objectPath=”StoreFlow[name=StoreLocator]” propertyName=”enabled” />

</PropertyGroup>

</PropertyPane>

Append the following code snippet:

<PropertyCheckbox helpText=”${stoFlexFlowExt_10151.<Store feature name>.checkboxEnable.title}” name=”<Store feature name>.checkbox” objectPath=”StoreFlow[name=<Store feature name>]” promptText=”${stoFlexFlowExt_10151.<Store feature name>.checkboxEnable.label}” propertyName=”enabled”/>

Step5: Build the Lazlo project(Lob Tools) and restart the server

Step6 : Verify the changes in CMC tool.

Login to Commerce Management center-> Select Store Management ->Select  Store<ex: Aurora> -> select Configurations tab.

Here you can find the newly added store feature.

Usage 

  • if(TagHandlerHelper.isStore featureEnabled(“<Store feature name>”)!= null && TagHandlerHelper.isStore featureEnabled(“<Store feature name>”)){

// business logic to apply  shopping conditions.

}

  • Display shopping conditions to the customer or not.

<flow:ifEnabled Store feature=”<Store feature name>”>

//Content to display the shopping condition to customer.

</flow:ifEnabled>

About The Author

Leave a Reply

*