O'Reilly logo

PrestaShop Module Development by Fabien Serny

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the Configuration class with multistore

You are probably asking yourself what about the Configuration class? We used it to store the module configuration, so what do we need to do if we want to make different configurations for each shop? The answer is: nothing.

The Configuration class is natively compliant with the multistore feature. If we look closer to the code of this class, we will see that the loadConfiguration method retrieves configuration values and splits them as per the shop:

if ($row['id_shop']) self::$_CONF[$lang]['shop'][$row['id_shop']][$row['name']]= $row['value']; else if ($row['id_shop_group']) self::$_CONF[$lang]['group'][$row['id_shop_group']][$row['name']] = $row['value']; else self::$_CONF[$lang]['global'][$row['name']] ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required