source/Application/Controller/Admin/ActionsGroupsAjax.php
public function addPromotionGroup()
    {
        $aChosenGroup = $this->_getActionIds('oxgroups.oxid');
        $soxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid');

        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) {
            $sGroupTable = $this->_getViewName('oxgroups');
            $aChosenGroup = $this->_getAll($this->_addFilter("select $sGroupTable.oxid " . $this->_getQuery()));
        }

        $promotionAdded = false;
        if ($soxId && $soxId != "-1" && is_array($aChosenGroup)) {
            foreach ($aChosenGroup as $sChosenGroup) {
                $oObject2Promotion = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
                $oObject2Promotion->init('oxobject2action');
                $oObject2Promotion->oxobject2action__oxactionid = new \OxidEsales\Eshop\Core\Field($soxId);
                $oObject2Promotion->oxobject2action__oxobjectid = new \OxidEsales\Eshop\Core\Field($sChosenGroup);
                $oObject2Promotion->oxobject2action__oxclass = new \OxidEsales\Eshop\Core\Field("oxgroups");
                $oObject2Promotion->save();
            }

            $promotionAdded = true;
        }

        return $promotionAdded;
    }
public function addPromotionGroup()
    {
        $aChosenGroup = $this->_getActionIds('oxgroups.oxid');
        $soxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid');

        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) {
            $sGroupTable = $this->_getViewName('oxgroups');
            $aChosenGroup = $this->_getAll($this->_addFilter("select $sGroupTable.oxid " . $this->_getQuery()));
        }

        $promotionAdded = false;
        if ($soxId && $soxId != "-1" && is_array($aChosenGroup)) {
            foreach ($aChosenGroup as $sChosenGroup) {
                $oObject2Promotion = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
                $oObject2Promotion->init('oxobject2action');
                $oObject2Promotion->oxobject2action__oxactionid = new \OxidEsales\Eshop\Core\Field($soxId);
                $oObject2Promotion->oxobject2action__oxobjectid = new \OxidEsales\Eshop\Core\Field($sChosenGroup);
                $oObject2Promotion->oxobject2action__oxclass = new \OxidEsales\Eshop\Core\Field("oxgroups");
                $oObject2Promotion->save();
            }

            $promotionAdded = true;
        }

        return $promotionAdded;
    }
public function addPromotionGroup ( ) { $ aChosenGroup = $ this -> _getActionIds ( 'oxgroups.oxid' ) ; $ soxId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'synchoxid' ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'all' ) ) { $ sGroupTable = $ this -> _getViewName ( 'oxgroups' ) ; $ aChosenGroup = $ this -> _getAll ( $ this -> _addFilter ( "select $sGroupTable.oxid " . $ this -> _getQuery ( ) ) ) ; } $ promotionAdded = false ; if ( $ soxId && $ soxId != "-1" && is_array ( $ aChosenGroup ) ) { foreach ( $ aChosenGroup as $ sChosenGroup ) { $ oObject2Promotion = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ BaseModel :: class ) ; $ oObject2Promotion -> init ( 'oxobject2action' ) ; $ oObject2Promotion -> oxobject2action__oxactionid = new \ OxidEsales \ Eshop \ Core \ Field ( $ soxId ) ; $ oObject2Promotion -> oxobject2action__oxobjectid = new \ OxidEsales \ Eshop \ Core \ Field ( $ sChosenGroup ) ; $ oObject2Promotion -> oxobject2action__oxclass = new \ OxidEsales \ Eshop \ Core \ Field ( "oxgroups" ) ; $ oObject2Promotion -> save ( ) ; } $ promotionAdded = true ; } return $ promotionAdded ; }
Adds user group to promotion

@return bool Whether at least one promotion was added.
Adds user group to promotion