source/Application/Model/Order.php
public function delete($sOxId = null)
    {
        if ($sOxId) {
            if (!$this->load($sOxId)) {
                // such order does not exist
                return false;
            }
        } elseif (!$sOxId) {
            $sOxId = $this->getId();
        }

        // no order id is passed
        if (!$sOxId) {
            return false;
        }

        // delete order articles
        $oOrderArticles = $this->getOrderArticles(false);
        foreach ($oOrderArticles as $oOrderArticle) {
            $oOrderArticle->delete();
        }

        // #440 - deleting user payment info
        if ($oPaymentType = $this->getPaymentType()) {
            $oPaymentType->delete();
        }

        return parent::delete($sOxId);
    }
public function delete($sOxId = null)
    {
        if ($sOxId) {
            if (!$this->load($sOxId)) {
                // such order does not exist
                return false;
            }
        } elseif (!$sOxId) {
            $sOxId = $this->getId();
        }

        // no order id is passed
        if (!$sOxId) {
            return false;
        }

        // delete order articles
        $oOrderArticles = $this->getOrderArticles(false);
        foreach ($oOrderArticles as $oOrderArticle) {
            $oOrderArticle->delete();
        }

        // #440 - deleting user payment info
        if ($oPaymentType = $this->getPaymentType()) {
            $oPaymentType->delete();
        }

        return parent::delete($sOxId);
    }
public function delete ( $ sOxId = null ) { if ( $ sOxId ) { if ( ! $ this -> load ( $ sOxId ) ) { // such order does not exist return false ; } } elseif ( ! $ sOxId ) { $ sOxId = $ this -> getId ( ) ; } // no order id is passed if ( ! $ sOxId ) { return false ; } // delete order articles $ oOrderArticles = $ this -> getOrderArticles ( false ) ; foreach ( $ oOrderArticles as $ oOrderArticle ) { $ oOrderArticle -> delete ( ) ; } // #440 - deleting user payment info if ( $ oPaymentType = $ this -> getPaymentType ( ) ) { $ oPaymentType -> delete ( ) ; } return parent :: delete ( $ sOxId ) ; }
Updates stock information, deletes current ordering details from DB,
returns true on success.

@param string $sOxId Ordering ID (default null)

@return bool
Updates stock information deletes current ordering details from DB returns true on success .