Skip to content

Commit

Permalink
Fix2: wrong id parameter used in product variations
Browse files Browse the repository at this point in the history
  • Loading branch information
duracelltomi committed Apr 2, 2024
1 parent 8e71bec commit cae6a76
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/gtm4wp-woocommerce.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit cae6a76

Please sign in to comment.