Skip to content

Commit eca54e8

Browse files
committed
feat: wooCommerce removed from cart trigger fields added
1 parent 9a93ea5 commit eca54e8

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

includes/Triggers/WC/WCController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ public static function fields($id)
223223
$entity = 'coupon';
224224
} elseif ($id == static::PRODUCT_ADD_TO_CART) {
225225
$entity = 'add_to_cart';
226+
} elseif ($id == static::PRODUCT_REMOVE_FROM_CART) {
227+
$entity = 'remove_from_cart';
226228
}
227229

228230
if (empty($id)) {
@@ -261,6 +263,10 @@ public static function fields($id)
261263
case 'add_to_cart':
262264
$fields = WCStaticFields::getAddToCartFields();
263265

266+
break;
267+
case 'remove_from_cart':
268+
$fields = WCStaticFields::getRemoveFromCartFields();
269+
264270
break;
265271

266272
default:

includes/Triggers/WC/WCStaticFields.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,28 @@ public static function getAddToCartFields()
230230
];
231231
}
232232

233+
public static function getRemoveFromCartFields()
234+
{
235+
return [
236+
'Cart Item Key' => (object) [
237+
'fieldKey' => 'cart_item_key',
238+
'fieldName' => __('Cart Item Key', 'bit-integrations')
239+
],
240+
'Applied Coupons' => (object) [
241+
'fieldKey' => 'applied_coupons',
242+
'fieldName' => __('Applied Coupons', 'bit-integrations')
243+
],
244+
'Cart Session Data' => (object) [
245+
'fieldKey' => 'cart_session_data',
246+
'fieldName' => __('Cart Session Data', 'bit-integrations')
247+
],
248+
'Removed Cart Contents' => (object) [
249+
'fieldKey' => 'removed_cart_contents',
250+
'fieldName' => __('Removed Cart Contents', 'bit-integrations')
251+
]
252+
];
253+
}
254+
233255
private static function getOrderACFFields($type = [])
234256
{
235257
if (!class_exists('ACF')) {

0 commit comments

Comments
 (0)