Skip to content

Commit

Permalink
Fix: Reference Error on Woocommerce
Browse files Browse the repository at this point in the history
Changed product_data to productData in the woocommerce.js integration
Thereby fixing: ReferenceError: product_data is not defined
  • Loading branch information
Sakuk3 authored Mar 27, 2024
1 parent c682f0e commit 6f45cac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/gtm4wp-woocommerce.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function gtm4wp_woocommerce_handle_cart_qty_change() {
productdata.quantity = current_value - original_value;
productdata.price = productdata.price;

gtm4wp_push_ecommerce( 'add_to_cart', [ product_data ], {
gtm4wp_push_ecommerce( 'add_to_cart', [ productdata ], {
'currency': gtm4wp_currency, // ga4 version
'value': productdata.price * productdata.quantity
});
Expand All @@ -42,7 +42,7 @@ function gtm4wp_woocommerce_handle_cart_qty_change() {
productdata.quantity = original_value - current_value;
productdata.price = productdata.price;

gtm4wp_push_ecommerce( 'remove_from_cart', [ product_data ], {
gtm4wp_push_ecommerce( 'remove_from_cart', [ productdata ], {
'currency': gtm4wp_currency,
'value': productdata.price * productdata.quantity
});
Expand Down

0 comments on commit 6f45cac

Please sign in to comment.