source/Application/Model/VariantSelectList.php
public function addVariant($sName, $sValue, $blDisabled, $blActive)
    {
        $sName = trim($sName);
        //#6053 Allow "0" as a valid value.
        if (!empty($sName) || $sName === '0') {
            $sKey = $sValue;

            // creating new
            if (!isset($this->_aList[$sKey])) {
                $this->_aList[$sKey] = oxNew(\OxidEsales\Eshop\Application\Model\Selection::class, $sName, $sValue, $blDisabled, $blActive);
            } else {
                // overriding states
                if ($this->_aList[$sKey]->isDisabled() && !$blDisabled) {
                    $this->_aList[$sKey]->setDisabled($blDisabled);
                }

                if (!$this->_aList[$sKey]->isActive() && $blActive) {
                    $this->_aList[$sKey]->setActiveState($blActive);
                }
            }

            // storing active selection
            if ($this->_aList[$sKey]->isActive()) {
                $this->_oActiveSelection = $this->_aList[$sKey];
            }
        }
    }
public function addVariant($sName, $sValue, $blDisabled, $blActive)
    {
        $sName = trim($sName);
        //#6053 Allow "0" as a valid value.
        if (!empty($sName) || $sName === '0') {
            $sKey = $sValue;

            // creating new
            if (!isset($this->_aList[$sKey])) {
                $this->_aList[$sKey] = oxNew(\OxidEsales\Eshop\Application\Model\Selection::class, $sName, $sValue, $blDisabled, $blActive);
            } else {
                // overriding states
                if ($this->_aList[$sKey]->isDisabled() && !$blDisabled) {
                    $this->_aList[$sKey]->setDisabled($blDisabled);
                }

                if (!$this->_aList[$sKey]->isActive() && $blActive) {
                    $this->_aList[$sKey]->setActiveState($blActive);
                }
            }

            // storing active selection
            if ($this->_aList[$sKey]->isActive()) {
                $this->_oActiveSelection = $this->_aList[$sKey];
            }
        }
    }
public function addVariant ( $ sName , $ sValue , $ blDisabled , $ blActive ) { $ sName = trim ( $ sName ) ; //#6053 Allow "0" as a valid value. if ( ! empty ( $ sName ) || $ sName === '0' ) { $ sKey = $ sValue ; // creating new if ( ! isset ( $ this -> _aList [ $ sKey ] ) ) { $ this -> _aList [ $ sKey ] = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Selection :: class , $ sName , $ sValue , $ blDisabled , $ blActive ) ; } else { // overriding states if ( $ this -> _aList [ $ sKey ] -> isDisabled ( ) && ! $ blDisabled ) { $ this -> _aList [ $ sKey ] -> setDisabled ( $ blDisabled ) ; } if ( ! $ this -> _aList [ $ sKey ] -> isActive ( ) && $ blActive ) { $ this -> _aList [ $ sKey ] -> setActiveState ( $ blActive ) ; } } // storing active selection if ( $ this -> _aList [ $ sKey ] -> isActive ( ) ) { $ this -> _oActiveSelection = $ this -> _aList [ $ sKey ] ; } } }
Adds given variant info to current variant selection list

@param string $sName      selection name
@param string $sValue     selection value
@param string $blDisabled selection state - disabled/enabled
@param string $blActive   selection state - active/inactive
Adds given variant info to current variant selection list