Documentation

Finalizing recalculation

You can use order final recalculation events for solving individual objectives in cases when an order is at "consistent" state, i. e. field data was already calculated based on the available order information.

EventDescription and parameters
OnBeforeSaleOrderFinalAction Triggered directly before final calculation.

Parameters
ENTITY Order object.
HAS_MEANINGFUL_FIELD Field update flag that can affect the recalculation.
BASKET Shopping cart object.
OnAfterSaleOrderFinalAction Triggered when order is fully calculated.

Parameters
ENTITY Order object.

Example

//example of event OnAfterSaleOrderFinalAction

\Bitrix\Main\EventManager::getInstance()->addEventHandler(
    'sale',
    'OnAfterSaleOrderFinalAction',
    'myFunction'
);

//handler receives total amount used for specific next actions:

function myFunction(\Bitrix\Main\Event $event)
{
    /** @var \Bitrix\Sale\Order $order */
    $order = $event->getParameter('ENTITY');
    $sum = $order->getPrice();
    // . . . 
}



© «Bitrix24», 2001-2024