NewUser
NewUser

Reputation: 13333

Prestashop create module for multistore

I want to create a module in prestashop which will be compatible in multisite. So can someone tell me how to make a module which will be compatible in multistore. Any help and suggestions will be really appreciable. Thanks

Upvotes: 1

Views: 1319

Answers (1)

Guillaume 1TN
Guillaume 1TN

Reputation: 41

If you just follow the official guidelines for creating a module, your module will be multistore.

Basically, in your code, if you use the Configuration class (Configuration::updateValue() for example), your changes will be applied for the current store. If you want to make changes for all the stores, you will have to you set/get the context, for example :

if (Shop::isFeatureActive())
  Shop::setContext(Shop::CONTEXT_ALL);

The page "Using the context object" is really usefull too if you plan on writing template files.

Upvotes: 1

Related Questions