source/Application/Controller/ArticleDetailsController.php
public function getProduct()
    {
        $config = \OxidEsales\Eshop\Core\Registry::getConfig();
        $utils = \OxidEsales\Eshop\Core\Registry::getUtils();

        if ($this->_oProduct === null) {
            //this option is only for lists and we must reset value
            //as blLoadVariants = false affect "ab price" functionality
            $config->setConfigParam('blLoadVariants', true);

            $articleId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('anid');

            // object is not yet loaded
            $this->_oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);

            if (!$this->_oProduct->load($articleId)) {
                $utils->redirect($config->getShopHomeUrl());
                $utils->showMessageAndExit('');
            }

            $variantSelectionId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("varselid");
            $variantSelections = $this->_oProduct->getVariantSelections($variantSelectionId);
            if ($variantSelections && $variantSelections['oActiveVariant'] && $variantSelections['blPerfectFit']) {
                $this->_oProduct = $variantSelections['oActiveVariant'];
            }
        }

        // additional checks
        if (!$this->_blIsInitialized) {
            $this->_additionalChecksForArticle();
        }

        return $this->_oProduct;
    }
public function getProduct()
    {
        $config = \OxidEsales\Eshop\Core\Registry::getConfig();
        $utils = \OxidEsales\Eshop\Core\Registry::getUtils();

        if ($this->_oProduct === null) {
            //this option is only for lists and we must reset value
            //as blLoadVariants = false affect "ab price" functionality
            $config->setConfigParam('blLoadVariants', true);

            $articleId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('anid');

            // object is not yet loaded
            $this->_oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);

            if (!$this->_oProduct->load($articleId)) {
                $utils->redirect($config->getShopHomeUrl());
                $utils->showMessageAndExit('');
            }

            $variantSelectionId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("varselid");
            $variantSelections = $this->_oProduct->getVariantSelections($variantSelectionId);
            if ($variantSelections && $variantSelections['oActiveVariant'] && $variantSelections['blPerfectFit']) {
                $this->_oProduct = $variantSelections['oActiveVariant'];
            }
        }

        // additional checks
        if (!$this->_blIsInitialized) {
            $this->_additionalChecksForArticle();
        }

        return $this->_oProduct;
    }
public function getProduct ( ) { $ config = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ utils = \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) ; if ( $ this -> _oProduct === null ) { //this option is only for lists and we must reset value //as blLoadVariants = false affect "ab price" functionality $ config -> setConfigParam ( 'blLoadVariants' , true ) ; $ articleId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'anid' ) ; // object is not yet loaded $ this -> _oProduct = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; if ( ! $ this -> _oProduct -> load ( $ articleId ) ) { $ utils -> redirect ( $ config -> getShopHomeUrl ( ) ) ; $ utils -> showMessageAndExit ( '' ) ; } $ variantSelectionId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "varselid" ) ; $ variantSelections = $ this -> _oProduct -> getVariantSelections ( $ variantSelectionId ) ; if ( $ variantSelections && $ variantSelections [ 'oActiveVariant' ] && $ variantSelections [ 'blPerfectFit' ] ) { $ this -> _oProduct = $ variantSelections [ 'oActiveVariant' ] ; } } // additional checks if ( ! $ this -> _blIsInitialized ) { $ this -> _additionalChecksForArticle ( ) ; } return $ this -> _oProduct ; }
Returns current product

@return \OxidEsales\Eshop\Application\Model\Article
Returns current product