source/Application/Controller/Admin/CategoryOrderAjax.php
public function saveNewOrder()
    {
        $oCategory = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
        $sId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxid");
        if ($oCategory->load($sId)) {
            //Disable editing for derived items
            if ($oCategory->isDerived()) {
                return;
            }

            $this->resetContentCache();

            $aNewOrder = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("neworder_sess");
            if (is_array($aNewOrder) && count($aNewOrder)) {
                $sO2CView = $this->_getViewName('oxobject2category');
                $sSelect = "select * from $sO2CView where $sO2CView.oxcatnid='" . $oCategory->getId() . "' and $sO2CView.oxobjectid in (" . implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aNewOrder)) . " )";
                $oList = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
                $oList->init("oxbase", "oxobject2category");
                $oList->selectString($sSelect);

                // setting new position
                foreach ($oList as $oObj) {
                    if (($iNewPos = array_search($oObj->oxobject2category__oxobjectid->value, $aNewOrder)) !== false) {
                        $oObj->oxobject2category__oxpos->setValue($iNewPos);
                        $oObj->save();
                    }
                }

                \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('neworder_sess', null);
            }

            $this->onCategoryChange($sId);
        }
    }
public function saveNewOrder()
    {
        $oCategory = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
        $sId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxid");
        if ($oCategory->load($sId)) {
            //Disable editing for derived items
            if ($oCategory->isDerived()) {
                return;
            }

            $this->resetContentCache();

            $aNewOrder = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("neworder_sess");
            if (is_array($aNewOrder) && count($aNewOrder)) {
                $sO2CView = $this->_getViewName('oxobject2category');
                $sSelect = "select * from $sO2CView where $sO2CView.oxcatnid='" . $oCategory->getId() . "' and $sO2CView.oxobjectid in (" . implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aNewOrder)) . " )";
                $oList = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
                $oList->init("oxbase", "oxobject2category");
                $oList->selectString($sSelect);

                // setting new position
                foreach ($oList as $oObj) {
                    if (($iNewPos = array_search($oObj->oxobject2category__oxobjectid->value, $aNewOrder)) !== false) {
                        $oObj->oxobject2category__oxpos->setValue($iNewPos);
                        $oObj->save();
                    }
                }

                \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('neworder_sess', null);
            }

            $this->onCategoryChange($sId);
        }
    }
public function saveNewOrder ( ) { $ oCategory = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Category :: class ) ; $ sId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "oxid" ) ; if ( $ oCategory -> load ( $ sId ) ) { //Disable editing for derived items if ( $ oCategory -> isDerived ( ) ) { return ; } $ this -> resetContentCache ( ) ; $ aNewOrder = \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> getVariable ( "neworder_sess" ) ; if ( is_array ( $ aNewOrder ) && count ( $ aNewOrder ) ) { $ sO2CView = $ this -> _getViewName ( 'oxobject2category' ) ; $ sSelect = "select * from $sO2CView where $sO2CView.oxcatnid='" . $ oCategory -> getId ( ) . "' and $sO2CView.oxobjectid in (" . implode ( ", " , \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quoteArray ( $ aNewOrder ) ) . " )" ; $ oList = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ ListModel :: class ) ; $ oList -> init ( "oxbase" , "oxobject2category" ) ; $ oList -> selectString ( $ sSelect ) ; // setting new position foreach ( $ oList as $ oObj ) { if ( ( $ iNewPos = array_search ( $ oObj -> oxobject2category__oxobjectid -> value , $ aNewOrder ) ) !== false ) { $ oObj -> oxobject2category__oxpos -> setValue ( $ iNewPos ) ; $ oObj -> save ( ) ; } } \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( 'neworder_sess' , null ) ; } $ this -> onCategoryChange ( $ sId ) ; } }
Saves category articles ordering.

@return null
Saves category articles ordering .