1
0
mirror of synced 2025-01-31 07:11:42 +03:00

ref #95040 Cancellation of applied loyalty program bonuses (#334)

This commit is contained in:
Kocmonavtik 2024-06-10 17:59:42 +03:00 committed by GitHub
parent c0e805d514
commit d354b11ecb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -496,7 +496,13 @@ if (!class_exists('WC_Retailcrm_Orders')) :
if ($result !== []) {
$crmItems = $result['items'];
$this->cancelLoyalty = $this->order_item->isCancelLoyalty($wcItems, $crmItems);
if ($result['discountType'] !== null && in_array($order->get_status(), ['cancelled', 'refunded'])) {
$this->cancelLoyalty = true;
$this->order_item->cancelLoyalty = true;
} else {
$this->cancelLoyalty = $this->order_item->isCancelLoyalty($wcItems, $crmItems);
}
$this->loyaltyDiscountType = $result['discountType'];
}
}