source/Application/Model/Basket.php
public function calculateBasket($blForceUpdate = false)
    {
        /*
        //would be good to perform the reset of previous calculation
        //at least you can use it for the debug
        $this->_aDiscounts = array();
        $this->_aItemDiscounts = array();
        $this->_oTotalDiscount = null;
        $this->_dDiscountedProductNettoPrice = 0;
        $this->_aDiscountedVats = array();
        $this->_oPrice = null;
        $this->_oNotDiscountedProductsPriceList = null;
        $this->_oProductsPriceList = null;
        $this->_oDiscountProductsPriceList = null;*/

        if (!$this->isEnabled()) {
            return;
        }

        if ($blForceUpdate) {
            $this->onUpdate();
        }

        if (!($this->_blUpdateNeeded || $blForceUpdate)) {
            return;
        }

        $this->_aCosts = [];

        //  1. saving basket to the database
        $this->_save();

        //  2. remove all bundles
        $this->_clearBundles();

        //  3. generate bundle items
        $this->_addBundles();

        //  4. calculating item prices
        $this->_calcItemsPrice();

        //  5. calculating/applying discounts
        $this->_calcBasketDiscount();

        //  6. calculating basket total discount
        $this->_calcBasketTotalDiscount();

        //  7. check for vouchers
        $this->_calcVoucherDiscount();

        //  8. applies all discounts to pricelist
        $this->_applyDiscounts();

        //  9. calculating additional costs:
        //  9.1: delivery
        $this->setCost('oxdelivery', $this->_calcDeliveryCost());

        //  9.2: adding wrapping and gift card costs
        $this->setCost('oxwrapping', $this->_calcBasketWrapping());

        $this->setCost('oxgiftcard', $this->_calcBasketGiftCard());

        //  9.3: adding payment cost
        $this->setCost('oxpayment', $this->_calcPaymentCost());

        //  10. calculate total price
        $this->_calcTotalPrice();

        //  11. formatting discounts
        $this->formatDiscount();

        //  12.setting to up-to-date status
        $this->afterUpdate();
    }
public function calculateBasket($blForceUpdate = false)
    {
        /*
        //would be good to perform the reset of previous calculation
        //at least you can use it for the debug
        $this->_aDiscounts = array();
        $this->_aItemDiscounts = array();
        $this->_oTotalDiscount = null;
        $this->_dDiscountedProductNettoPrice = 0;
        $this->_aDiscountedVats = array();
        $this->_oPrice = null;
        $this->_oNotDiscountedProductsPriceList = null;
        $this->_oProductsPriceList = null;
        $this->_oDiscountProductsPriceList = null;*/

        if (!$this->isEnabled()) {
            return;
        }

        if ($blForceUpdate) {
            $this->onUpdate();
        }

        if (!($this->_blUpdateNeeded || $blForceUpdate)) {
            return;
        }

        $this->_aCosts = [];

        //  1. saving basket to the database
        $this->_save();

        //  2. remove all bundles
        $this->_clearBundles();

        //  3. generate bundle items
        $this->_addBundles();

        //  4. calculating item prices
        $this->_calcItemsPrice();

        //  5. calculating/applying discounts
        $this->_calcBasketDiscount();

        //  6. calculating basket total discount
        $this->_calcBasketTotalDiscount();

        //  7. check for vouchers
        $this->_calcVoucherDiscount();

        //  8. applies all discounts to pricelist
        $this->_applyDiscounts();

        //  9. calculating additional costs:
        //  9.1: delivery
        $this->setCost('oxdelivery', $this->_calcDeliveryCost());

        //  9.2: adding wrapping and gift card costs
        $this->setCost('oxwrapping', $this->_calcBasketWrapping());

        $this->setCost('oxgiftcard', $this->_calcBasketGiftCard());

        //  9.3: adding payment cost
        $this->setCost('oxpayment', $this->_calcPaymentCost());

        //  10. calculate total price
        $this->_calcTotalPrice();

        //  11. formatting discounts
        $this->formatDiscount();

        //  12.setting to up-to-date status
        $this->afterUpdate();
    }
public function calculateBasket ( $ blForceUpdate = false ) { /*
        //would be good to perform the reset of previous calculation
        //at least you can use it for the debug
        $this->_aDiscounts = array();
        $this->_aItemDiscounts = array();
        $this->_oTotalDiscount = null;
        $this->_dDiscountedProductNettoPrice = 0;
        $this->_aDiscountedVats = array();
        $this->_oPrice = null;
        $this->_oNotDiscountedProductsPriceList = null;
        $this->_oProductsPriceList = null;
        $this->_oDiscountProductsPriceList = null;*/ if ( ! $ this -> isEnabled ( ) ) { return ; } if ( $ blForceUpdate ) { $ this -> onUpdate ( ) ; } if ( ! ( $ this -> _blUpdateNeeded || $ blForceUpdate ) ) { return ; } $ this -> _aCosts = [ ] ; //  1. saving basket to the database $ this -> _save ( ) ; //  2. remove all bundles $ this -> _clearBundles ( ) ; //  3. generate bundle items $ this -> _addBundles ( ) ; //  4. calculating item prices $ this -> _calcItemsPrice ( ) ; //  5. calculating/applying discounts $ this -> _calcBasketDiscount ( ) ; //  6. calculating basket total discount $ this -> _calcBasketTotalDiscount ( ) ; //  7. check for vouchers $ this -> _calcVoucherDiscount ( ) ; //  8. applies all discounts to pricelist $ this -> _applyDiscounts ( ) ; //  9. calculating additional costs: //  9.1: delivery $ this -> setCost ( 'oxdelivery' , $ this -> _calcDeliveryCost ( ) ) ; //  9.2: adding wrapping and gift card costs $ this -> setCost ( 'oxwrapping' , $ this -> _calcBasketWrapping ( ) ) ; $ this -> setCost ( 'oxgiftcard' , $ this -> _calcBasketGiftCard ( ) ) ; //  9.3: adding payment cost $ this -> setCost ( 'oxpayment' , $ this -> _calcPaymentCost ( ) ) ; //  10. calculate total price $ this -> _calcTotalPrice ( ) ; //  11. formatting discounts $ this -> formatDiscount ( ) ; //  12.setting to up-to-date status $ this -> afterUpdate ( ) ; }
Executes all needed functions to calculate basket price and other needed
info

@param bool $blForceUpdate set this parameter to TRUE to force basket recalculation

@return null
Executes all needed functions to calculate basket price and other needed info