Skip to content

Commit f2aa8f9

Browse files
committed
feat: wooCommerce order status related trigger fields added
1 parent f968eee commit f2aa8f9

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

includes/Triggers/WC/WCController.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,25 @@ public static function fields($id)
213213
$entity = null;
214214
if ($id <= static::CUSTOMER_DELETED) {
215215
$entity = 'customer';
216-
} elseif ($id <= static::PRODUCT_DELETED || $id == static::RESTORE_PRODUCT || $id == static::PRODUCT_STATUS_CHANGED) {
216+
} elseif (
217+
$id <= static::PRODUCT_DELETED
218+
|| $id == static::RESTORE_PRODUCT
219+
|| $id == static::PRODUCT_STATUS_CHANGED
220+
) {
217221
$entity = 'product';
218-
} elseif ($id <= static::ORDER_STATUS_CHANGED_TO_SPECIFIC_STATUS || $id == static::RESTORE_ORDER || $id == static::ORDER_SPECIFIC_CATEGORY || $id == static::USER_PURCHASES_A_VARIABLE_PRODUCT) {
222+
} elseif (
223+
$id <= static::ORDER_STATUS_CHANGED_TO_SPECIFIC_STATUS
224+
|| $id == static::RESTORE_ORDER
225+
|| $id == static::ORDER_SPECIFIC_CATEGORY
226+
|| $id == static::USER_PURCHASES_A_VARIABLE_PRODUCT
227+
|| $id == static::ORDER_STATUS_SET_TO_PENDING
228+
|| $id == static::ORDER_STATUS_SET_TO_FAILED
229+
|| $id == static::ORDER_STATUS_SET_TO_ON_HOLD
230+
|| $id == static::ORDER_STATUS_SET_TO_PROCESSING
231+
|| $id == static::ORDER_STATUS_SET_TO_COMPLETED
232+
|| $id == static::ORDER_STATUS_SET_TO_REFUNDED
233+
|| $id == static::ORDER_STATUS_SET_TO_CANCELLED
234+
) {
219235
$entity = 'order';
220236
} elseif ($id <= static::USER_REVIEWS_A_PRODUCT) {
221237
$entity = 'review';

0 commit comments

Comments
 (0)