Skip to content
View in the app

A better way to browse. Learn more.

Clicshopping AI, Free generative artificial intelligence e-commerce Open Source , Open Source Store Onlne

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Configuration
Introduction

The main installation configuration parameters are stored in the following locations:

Type     Location
Global     Core/ClicShopping/Conf/global.php
Shop     Core/ClicShopping/Sites/Shop/site_conf.php
Shop     Core/ClicShopping/Sites/ClicShoppingAdmin/site_conf.php

The global configuration file and all site configuration files are automatically loaded into their own groups when the framework is initialized. The global configuration file is loaded into a 'global' group, and the site configuration files are loaded into their own Site group (eg, 'ClicShoppingAdmin', and 'Shop').

Reading a configuration value is first attempted at the Site level, and if the configuration key does not exist, the global value is returned. A Site level configuration parameter has priority over a global level parameter if a global level configuration parameter is also defined.

Custom Configuration Files

It's possible to create custom configuration files that have priority over the values from the core configuration files. Custom configuration files can be stored in the following locations:

Type     Location
Global     Core/ClicShopping/Custom/Conf/global.php
Per-Site     Core/ClicShopping/Custom/Sites/SITE/site_conf.php
Configuration File Format

The format of the configuration parameters are stored in a "ini" style format in a PHP file that is assigned to a $ini PHP variable. This style of configuration was chosen over a plain text .ini file to prevent configuration parameters being read in cases of the configuration files being publicly accessible through the web server.

An example format for the global configuration file is:

<?php
$ini = <<<EOD
db_server = "localhost"
db_server_username = "dbuser"
db_server_password = "dbpass"
db_database = "my_db_name"
db_table_prefix = "clic_"
store_sessions = "MySQL"
time_zone = "Europe/Berlin"
EOD;

An example of a Site configuration file is:

<?php
$ini = <<<EOD
dir_root = "/www/html/"
http_server = "https://demo.shop"
http_path = "/"
http_images_path = "images/"
http_cookie_domain = ".clicshopping.shop"
http_cookie_path = "/"
EOD;

External Configuration Files

External configuration files can be loaded using the following code:

use ClicShopping\OM\CLICSHOPPING;
CLICSHOPPING::loadConfigFile($path_of_file, 'ext_group');

This would load the configuration parameters of $path_of_file to the 'ext_group' configuration group.

It is important that the ini format is stored as a string to the $ini PHP variable otherwise the configuration parameters can not be parsed.

Retrieving Configuration Parameters

Configuration parameters can be retrieved using CLICSHOPPING::getConfig():

use ClicShopping\OM\CLICSHOPPING;
$value = CLICSHOPPING::getConfig('cfg_name');

In this example, the cfg_name configuration parameter from the current Site group is returned. If the current Site group does not contain the configuration parameter, the global group value is returned.

It's possible to define which group the configuration parameter should be loaded from by defining the group name:

use ClicShopping\OM\CLICSHOPPING;
$value = CLICSHOPPING::getConfig('cfg_name', 'ext_group');

This would load the cfg_name configuration parameter from the ext_group group.

The following can be used to first see if a configuration parameter exists:

use ClicShopping\OM\CLICSHOPPING;

if (CLICSHOPPING::configExists('cfg_name')) {
    ....
}

This will check if cfg_name exists in the current Site group or the global group.

Checking to see if a configuration parameter exists in a specific group is performed as follows:

use ClicShopping\OM\CLICSHOPPING;

if (CLICSHOPPING::configExists('cfg_name', 'ext_group')) {
    ....
}

Please note that if the configuration parameter does not exist in the specified group, a check is also performed in the global group.

Setting Configuration Parameters

Runtime configuration parameters can be set as follows:

use ClicShopping\OM\CLICSHOPPING;

$value = true;

CLICSHOPPING::setConfig('is_true', $value, 'ext_group');

If no group is specified in the third parameter, the configuration parameter would be set in the global group.

This function does not save the configuration parameter to the configuration file - it only sets a runtime configuration parameter value.

 

Guest
This topic is now closed to further replies.

Important Information

By using this site, you agree to our Terms of Use

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.