source/Core/Config.php
public function saveShopConfVar($varType, $varName, $varVal, $shopId = null, $module = '')
    {
        switch ($varType) {
            case 'arr':
            case 'aarr':
                $value = serialize($varVal);
                break;
            case 'bool':
                //config param
                $varVal = (($varVal == 'true' || $varVal) && $varVal && strcasecmp($varVal, "false"));
                //db value
                $value = $varVal ? "1" : "";
                break;
            case 'num':
                //config param
                $varVal = $varVal != '' ? Registry::getUtils()->string2Float($varVal) : '';
                $value = $varVal;
                break;
            default:
                $value = $varVal;
                break;
        }

        if (!$shopId) {
            $shopId = $this->getShopId();
        }

        // Update value only for current shop
        if ($shopId == $this->getShopId()) {
            $this->setConfigParam($varName, $varVal);
        }

        $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $shopIdQuoted = $db->quote($shopId);
        $moduleQuoted = $db->quote($module);
        $varNameQuoted = $db->quote($varName);
        $varTypeQuoted = $db->quote($varType);
        $varValueQuoted = $db->quote($value);
        $configKeyQuoted = $db->quote($this->getConfigParam('sConfigKey'));
        $newOXIDdQuoted = $db->quote(\OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUID());

        $query = "delete from oxconfig where oxshopid = $shopIdQuoted and oxvarname = $varNameQuoted and oxmodule = $moduleQuoted";
        $db->execute($query);

        $query = "insert into oxconfig (oxid, oxshopid, oxmodule, oxvarname, oxvartype, oxvarvalue)
               values($newOXIDdQuoted, $shopIdQuoted, $moduleQuoted, $varNameQuoted, $varTypeQuoted, ENCODE( $varValueQuoted, $configKeyQuoted) )";
        $db->execute($query);

        $this->informServicesAfterConfigurationChanged($varName, $shopId, $module);
    }
public function saveShopConfVar($varType, $varName, $varVal, $shopId = null, $module = '')
    {
        switch ($varType) {
            case 'arr':
            case 'aarr':
                $value = serialize($varVal);
                break;
            case 'bool':
                //config param
                $varVal = (($varVal == 'true' || $varVal) && $varVal && strcasecmp($varVal, "false"));
                //db value
                $value = $varVal ? "1" : "";
                break;
            case 'num':
                //config param
                $varVal = $varVal != '' ? Registry::getUtils()->string2Float($varVal) : '';
                $value = $varVal;
                break;
            default:
                $value = $varVal;
                break;
        }

        if (!$shopId) {
            $shopId = $this->getShopId();
        }

        // Update value only for current shop
        if ($shopId == $this->getShopId()) {
            $this->setConfigParam($varName, $varVal);
        }

        $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $shopIdQuoted = $db->quote($shopId);
        $moduleQuoted = $db->quote($module);
        $varNameQuoted = $db->quote($varName);
        $varTypeQuoted = $db->quote($varType);
        $varValueQuoted = $db->quote($value);
        $configKeyQuoted = $db->quote($this->getConfigParam('sConfigKey'));
        $newOXIDdQuoted = $db->quote(\OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUID());

        $query = "delete from oxconfig where oxshopid = $shopIdQuoted and oxvarname = $varNameQuoted and oxmodule = $moduleQuoted";
        $db->execute($query);

        $query = "insert into oxconfig (oxid, oxshopid, oxmodule, oxvarname, oxvartype, oxvarvalue)
               values($newOXIDdQuoted, $shopIdQuoted, $moduleQuoted, $varNameQuoted, $varTypeQuoted, ENCODE( $varValueQuoted, $configKeyQuoted) )";
        $db->execute($query);

        $this->informServicesAfterConfigurationChanged($varName, $shopId, $module);
    }
public function saveShopConfVar ( $ varType , $ varName , $ varVal , $ shopId = null , $ module = '' ) { switch ( $ varType ) { case 'arr' : case 'aarr' : $ value = serialize ( $ varVal ) ; break ; case 'bool' : //config param $ varVal = ( ( $ varVal == 'true' || $ varVal ) && $ varVal && strcasecmp ( $ varVal , "false" ) ) ; //db value $ value = $ varVal ? "1" : "" ; break ; case 'num' : //config param $ varVal = $ varVal != '' ? Registry :: getUtils ( ) -> string2Float ( $ varVal ) : '' ; $ value = $ varVal ; break ; default : $ value = $ varVal ; break ; } if ( ! $ shopId ) { $ shopId = $ this -> getShopId ( ) ; } // Update value only for current shop if ( $ shopId == $ this -> getShopId ( ) ) { $ this -> setConfigParam ( $ varName , $ varVal ) ; } $ db = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ shopIdQuoted = $ db -> quote ( $ shopId ) ; $ moduleQuoted = $ db -> quote ( $ module ) ; $ varNameQuoted = $ db -> quote ( $ varName ) ; $ varTypeQuoted = $ db -> quote ( $ varType ) ; $ varValueQuoted = $ db -> quote ( $ value ) ; $ configKeyQuoted = $ db -> quote ( $ this -> getConfigParam ( 'sConfigKey' ) ) ; $ newOXIDdQuoted = $ db -> quote ( \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsObject ( ) -> generateUID ( ) ) ; $ query = "delete from oxconfig where oxshopid = $shopIdQuoted and oxvarname = $varNameQuoted and oxmodule = $moduleQuoted" ; $ db -> execute ( $ query ) ; $ query = "insert into oxconfig (oxid, oxshopid, oxmodule, oxvarname, oxvartype, oxvarvalue)
               values($newOXIDdQuoted, $shopIdQuoted, $moduleQuoted, $varNameQuoted, $varTypeQuoted, ENCODE( $varValueQuoted, $configKeyQuoted) )" ; $ db -> execute ( $ query ) ; $ this -> informServicesAfterConfigurationChanged ( $ varName , $ shopId , $ module ) ; }
Updates or adds new shop configuration parameters to DB.
Arrays must be passed not serialized, serialized values are supported just for backward compatibility.

@param string $varType Variable Type
@param string $varName Variable name
@param mixed  $varVal  Variable value (can be string, integer or array)
@param string $shopId  Shop ID, default is current shop
@param string $module  Module name (empty for base options)
Updates or adds new shop configuration parameters to DB . Arrays must be passed not serialized serialized values are supported just for backward compatibility .