Store specific functionality changeable by the customer


#1

How can we implement store specific functionality configureable and changeable by the customer via Zed?
Two examples to clearify this task:

Example 1: We got a google analytics code in store1, that is different in store2. Currently solved as glossary key, but this feels like abusing the glossary functionality.

Example 2: We got a chatbot (Javascript snipped) that need to be displayed in store1 for one locale (and not in other locales) and should not be displayed in store2. Currently solved via hardcoded template rules, it’s not flexible and not expandable.

How do you solved this case in the past? What can we do to solve this better for our customers? Do you maybe got a module for that case?

Thanks,
Patrick


#2

Hi,

you can override the config for each store, each environment etc… See here -> \Spryker\Shared\Config\Config::init

You can set the google analytics code for each store different than other store and also pro environment.
For Locale overriding you can also set your config as array pro local if is active or not.

BR
Gio


#3

But the Config::init does not provide changeable configurations the customer or?
Can you please take up the first question, if there is a spryker option to handle that? Or it need to be implemented on our own.


#4

Hi,

@gpiemontese was just pointing out where the store specific code is loaded.

You would place the different config values for question 1 in the according config files (e.g. config/Shared/config_default_STORE.php).

For question 2 you could override templates in Store specific modules (e.g. src/Pyz/MyModuleSTORE/, see https://academy.spryker.com/enablement/tutorials_and_howtos/introduction_tutorials/t_stores.html).

I hope that helps already!

Cheers


#5

Example 1: We got a google analytics code in store1, that is different in store2. Currently solved as glossary key, but this feels like abusing the glossary functionality.

Or implement Google Tag Manager with only one account for all pages.
Like this: http://flintanalytics.com/track-multiple-websites-with-one-google-tag-manager-container/
This moves the config from the shop to the Tag Manager.