From cae6a7615fa4ad95c466da5200e1f7cd52dc43a2 Mon Sep 17 00:00:00 2001 From: Thomas Geiger Date: Tue, 2 Apr 2024 16:53:13 +0200 Subject: [PATCH] Fix2: wrong id parameter used in product variations --- js/gtm4wp-woocommerce.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/gtm4wp-woocommerce.js b/js/gtm4wp-woocommerce.js index 525c2b33..8b9f6227 100644 --- a/js/gtm4wp-woocommerce.js +++ b/js/gtm4wp-woocommerce.js @@ -513,8 +513,11 @@ function gtm4wp_woocommerce_process_pages() { current_product_detail_data.price = gtm4wp_make_sure_is_float( current_product_detail_data.price ); + current_product_detail_data.id = product_variation.variation_id; current_product_detail_data.item_id = product_variation.variation_id; + current_product_detail_data.sku = product_variation.sku; if ( gtm4wp_use_sku_instead && product_variation.sku && ('' !== product_variation.sku) ) { + current_product_detail_data.id = product_variation.sku; current_product_detail_data.item_id = product_variation.sku; } current_product_detail_data.price = gtm4wp_make_sure_is_float( product_variation.display_price );