source/Application/Controller/Admin/OrderArticle.php
public function addThisArticle()
    {
        $sOxid = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aid');
        $dAmount = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('am');
        $oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);

        if ($sOxid && $dAmount && $oProduct->load($sOxid)) {
            $sOrderId = $this->getEditObjectId();
            $oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
            if ($sOrderId && $oOrder->load($sOrderId)) {
                $oOrderArticle = oxNew(\OxidEsales\Eshop\Application\Model\OrderArticle::class);
                $oOrderArticle->oxorderarticles__oxartid = new \OxidEsales\Eshop\Core\Field($oProduct->getId());
                $oOrderArticle->oxorderarticles__oxartnum = new \OxidEsales\Eshop\Core\Field($oProduct->oxarticles__oxartnum->value);
                $oOrderArticle->oxorderarticles__oxamount = new \OxidEsales\Eshop\Core\Field($dAmount);
                $oOrderArticle->oxorderarticles__oxselvariant = new \OxidEsales\Eshop\Core\Field(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('sel'));
                $oOrder->recalculateOrder([$oOrderArticle]);
            }
        }
    }
public function addThisArticle()
    {
        $sOxid = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aid');
        $dAmount = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('am');
        $oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);

        if ($sOxid && $dAmount && $oProduct->load($sOxid)) {
            $sOrderId = $this->getEditObjectId();
            $oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
            if ($sOrderId && $oOrder->load($sOrderId)) {
                $oOrderArticle = oxNew(\OxidEsales\Eshop\Application\Model\OrderArticle::class);
                $oOrderArticle->oxorderarticles__oxartid = new \OxidEsales\Eshop\Core\Field($oProduct->getId());
                $oOrderArticle->oxorderarticles__oxartnum = new \OxidEsales\Eshop\Core\Field($oProduct->oxarticles__oxartnum->value);
                $oOrderArticle->oxorderarticles__oxamount = new \OxidEsales\Eshop\Core\Field($dAmount);
                $oOrderArticle->oxorderarticles__oxselvariant = new \OxidEsales\Eshop\Core\Field(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('sel'));
                $oOrder->recalculateOrder([$oOrderArticle]);
            }
        }
    }
public function addThisArticle ( ) { $ sOxid = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'aid' ) ; $ dAmount = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'am' ) ; $ oProduct = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; if ( $ sOxid && $ dAmount && $ oProduct -> load ( $ sOxid ) ) { $ sOrderId = $ this -> getEditObjectId ( ) ; $ oOrder = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Order :: class ) ; if ( $ sOrderId && $ oOrder -> load ( $ sOrderId ) ) { $ oOrderArticle = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ OrderArticle :: class ) ; $ oOrderArticle -> oxorderarticles__oxartid = new \ OxidEsales \ Eshop \ Core \ Field ( $ oProduct -> getId ( ) ) ; $ oOrderArticle -> oxorderarticles__oxartnum = new \ OxidEsales \ Eshop \ Core \ Field ( $ oProduct -> oxarticles__oxartnum -> value ) ; $ oOrderArticle -> oxorderarticles__oxamount = new \ OxidEsales \ Eshop \ Core \ Field ( $ dAmount ) ; $ oOrderArticle -> oxorderarticles__oxselvariant = new \ OxidEsales \ Eshop \ Core \ Field ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'sel' ) ) ; $ oOrder -> recalculateOrder ( [ $ oOrderArticle ] ) ; } } }
Adds article to order list.
Adds article to order list .