Missing variable products
-
I’m using Tag Assistant (by Google) chrome extension, I’ve observed that when the event “order_confirmation” is triggered in the Thank you page. Only the last variable product is added in the Conversions > Ecommerce > Product Performance.
Looking at the code:
file enhanced-e-commerce-for-woocommerce-store/public/class-enhanced-ecommerce-google-analytics-public.php
line ~305if (isset($_product->variation_data)) { $orderpage_prod_Array[get_permalink($_product->ID)]=array( "tvc_id" => esc_html($_product->ID), "tvc_i" => esc_js($_product->get_sku() ? $_product->get_sku() : $_product->ID), "tvc_n" => html_entity_decode($item["name"]), "tvc_p" => esc_js($order->get_item_total($item)), "tvc_c" => $categories, "tvc_attr" => $attributes, "tvc_q"=>esc_js($item["qty"]) ); } else {
The code $_product->ID returns “”. Fixed it with this code.
if (isset($_product->variation_data)) { if(version_compare($woocommerce->version, "2.7", "<")){ $orderpage_prod_Array[get_permalink($_product->ID)]=array( "tvc_id" => esc_html($_product->ID), "tvc_i" => esc_js($_product->get_sku() ? $_product->get_sku() : $_product->ID), "tvc_n" => html_entity_decode($item["name"]), "tvc_p" => esc_js($order->get_item_total($item)), "tvc_c" => $categories, "tvc_attr" => $attributes, "tvc_q"=>esc_js($item["qty"]) ); } else { $orderpage_prod_Array[get_permalink($_product->get_id())]=array( "tvc_id" => esc_html($_product->get_id()), "tvc_i" => esc_js($_product->get_sku() ? $_product->get_sku() : $_product->get_id()), "tvc_n" => html_entity_decode($item["name"]), "tvc_p" => esc_js($order->get_item_total($item)), "tvc_c" => $categories, "tvc_attr" => $attributes, "tvc_q"=>esc_js($item["qty"]) ); } } else {
Hoping that the fix would be included in the next release.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Missing variable products’ is closed to new replies.