From 158df2b6c4893bc5a88b767abb67ddae429faf2a Mon Sep 17 00:00:00 2001 From: Torben Lundsgaard Date: Wed, 25 Sep 2024 14:32:46 +0200 Subject: [PATCH] Add the filter gtmkit_disable_frontend_purchase_event --- src/Integration/WooCommerce.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Integration/WooCommerce.php b/src/Integration/WooCommerce.php index d0a4645..2a20075 100644 --- a/src/Integration/WooCommerce.php +++ b/src/Integration/WooCommerce.php @@ -490,7 +490,7 @@ public function get_datalayer_content_order_received( array $data_layer ): array $order_id = apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars['order-received'] ) ); - if ( ! $order_id ) { + if ( ! $order_id || apply_filters( 'gtmkit_disable_frontend_purchase_event', false ) ) { return $data_layer; }