Enhanced Ecommerce Google Analytics for WooCommerce by TheDotStore
- to file wp-content\plugins\woo-ecommerce-tracking-for-google-and-facebook\public\class-advance-ecommerce-tracking-public.php add next code:
if (class_exists('WOOCS')) { global $WOOCS; $currencies = $WOOCS->get_currencies(); $_order_currency = get_post_meta($order_id, '_order_currency', true); $order_rate = get_post_meta($order_id, '_woocs_order_rate', true); if (!$order_rate) { if (isset($currencies[$_order_currency])) { $order_rate = $currencies[$_order_currency]['rate']; } else { $order_rate = 1; } } if ($_order_currency != $WOOCS->default_currency) { $orders_detail['order_sub_total'] = $WOOCS->back_convert($orders_detail['order_sub_total'], $order_rate, 2); $orders_detail['shipping_total'] = $WOOCS->back_convert($orders_detail['shipping_total'], $order_rate, 2); $orders_detail['order_total'] = $WOOCS->back_convert($orders_detail['order_total'], $order_rate, 2); $orders_detail['tax'] = $WOOCS->back_convert($orders_detail['tax'], $order_rate, 2); $orders_detail['coupon_discount'] = $WOOCS->back_convert($orders_detail['coupon_discount'], $order_rate, 2); } }
- in file wp-content\plugins\woo-ecommerce-tracking-for-google-and-facebook\public\class-advance-ecommerce-tracking-public.php add next code:
if (class_exists('WOOCS')) { global $WOOCS; $current_currency = $WOOCS->current_currency; if ($WOOCS->default_currency != $current_currency) { $WOOCS->reset_currency(); } }
- and to the same file add next code:
if (class_exists('WOOCS')) { global $WOOCS; if ($WOOCS->current_currency != $current_currency) { $WOOCS->set_currency($current_currency); } }
This edit is inside another plugin's file, so a plugin update will undo it. Write the change down, and re-apply it after every update of that plugin — or ask its authors to include the fix on their side, which is the only version that survives. If the change is inside FOX itself, tell us: a fix that has to be re-applied by hand is a bug on our side, not a solution.