Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
You need to change not the shipping cost, but the shipping cost. Something like this:
$eventManager = \Bitrix\Main\EventManager::getInstance();
$eventManager->addEventHandler('sale', 'OnSaleOrderBeforeSaved', ['OrderEvents', 'onBeforeOrderSaveHandler']);
class OrderEvents {
public static function onBeforeOrderSaveHandler(\Bitrix\Main\Event $event) {
$order = $event->getParameter('ENTITY');
$shipmentCollection = $order->getShipmentCollection();
foreach($shipmentCollection as $shipment) {
if(!$shipment->isSystem())
$shipment->setBasePriceDelivery(0, false);
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question