diff --git a/changelog.txt b/changelog.txt index 5462a81..69836d8 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ *** GTM Kit *** +2024-10-DD - version 2.2.1 +* Fix: If the cart and checkout endpoints where set to the same page in order to skip the cart the 'checkout' and 'purchase' events would not fire. + 2024-10-16 - version 2.2.0 * Add: Added notifications and warnings for missing GTM container, debug log usage, auto-update and event inspector usage. These improvements aim to ensure smooth production operations. diff --git a/readme.txt b/readme.txt index 67d89a2..5f2605b 100644 --- a/readme.txt +++ b/readme.txt @@ -101,6 +101,7 @@ Find out about what's new in our [our release post](https://gtmkit.com/gtm-kit-2 #### Enhancements: #### Bugfixes: +* If the cart and checkout endpoints where set to the same page in order to skip the cart the 'checkout' and 'purchase' events would not fire. #### Other: diff --git a/src/Integration/WooCommerce.php b/src/Integration/WooCommerce.php index 4c91f6f..16e5ba4 100644 --- a/src/Integration/WooCommerce.php +++ b/src/Integration/WooCommerce.php @@ -348,12 +348,12 @@ public function get_datalayer_content( array $data_layer ): array { $data_layer = $this->get_datalayer_content_product_category( $data_layer ); } elseif ( is_product_tag() ) { $data_layer = $this->get_datalayer_content_product_tag( $data_layer ); - } elseif ( is_cart() ) { - $data_layer = $this->get_datalayer_content_cart( $data_layer ); } elseif ( is_order_received_page() ) { $data_layer = $this->get_datalayer_content_order_received( $data_layer ); } elseif ( is_checkout() ) { $data_layer = $this->get_datalayer_content_checkout( $data_layer ); + } elseif ( is_cart() ) { + $data_layer = $this->get_datalayer_content_cart( $data_layer ); } if ( $this->options->get( 'integrations', 'woocommerce_include_permalink_structure' ) ) {