source/Application/Model/VariantHandler.php
protected function _createNewVariant($aParams = null, $sParentId = null)
    {
        // checkbox handling
        $aParams['oxarticles__oxactive'] = 0;

        // shopid
        $sShopID = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("actshop");
        $aParams['oxarticles__oxshopid'] = $sShopID;

        // varianthandling
        $aParams['oxarticles__oxparentid'] = $sParentId;

        $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
        $oArticle->setEnableMultilang(false);
        $oArticle->assign($aParams);
        $oArticle->save();

        return $oArticle->getId();
    }
protected function _createNewVariant($aParams = null, $sParentId = null)
    {
        // checkbox handling
        $aParams['oxarticles__oxactive'] = 0;

        // shopid
        $sShopID = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("actshop");
        $aParams['oxarticles__oxshopid'] = $sShopID;

        // varianthandling
        $aParams['oxarticles__oxparentid'] = $sParentId;

        $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
        $oArticle->setEnableMultilang(false);
        $oArticle->assign($aParams);
        $oArticle->save();

        return $oArticle->getId();
    }
protected function _createNewVariant ( $ aParams = null , $ sParentId = null ) { // checkbox handling $ aParams [ 'oxarticles__oxactive' ] = 0 ; // shopid $ sShopID = \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> getVariable ( "actshop" ) ; $ aParams [ 'oxarticles__oxshopid' ] = $ sShopID ; // varianthandling $ aParams [ 'oxarticles__oxparentid' ] = $ sParentId ; $ oArticle = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; $ oArticle -> setEnableMultilang ( false ) ; $ oArticle -> assign ( $ aParams ) ; $ oArticle -> save ( ) ; return $ oArticle -> getId ( ) ; }
Creates new article variant.

@param array  $aParams   assigned parameters
@param string $sParentId parent article id

@return null
Creates new article variant .