@@ -120,7 +120,7 @@ public function getOrdersTrackingCode()
120120 $ result [] = "ga('require', 'ec', 'ec.js'); " ;
121121
122122 foreach ($ collection as $ order ) {
123- $ result [] = "ga('set', 'currencyCode', ' " . $ order ->getBaseCurrencyCode () . "'); " ;
123+ $ result [] = "ga('set', 'currencyCode', ' " . $ order ->getOrderCurrencyCode () . "'); " ;
124124 foreach ($ order ->getAllVisibleItems () as $ item ) {
125125 $ result [] = sprintf (
126126 "ga('ec:addProduct', {
@@ -131,7 +131,7 @@ public function getOrdersTrackingCode()
131131 }); " ,
132132 $ this ->escapeJs ($ item ->getSku ()),
133133 $ this ->escapeJs ($ item ->getName ()),
134- $ item ->getBasePrice (),
134+ $ item ->getPrice (),
135135 $ item ->getQtyOrdered ()
136136 );
137137 }
@@ -146,9 +146,9 @@ public function getOrdersTrackingCode()
146146 }); " ,
147147 $ order ->getIncrementId (),
148148 $ this ->escapeJs ($ this ->_storeManager ->getStore ()->getFrontendName ()),
149- $ order ->getBaseGrandTotal (),
150- $ order ->getBaseTaxAmount (),
151- $ order ->getBaseShippingAmount ()
149+ $ order ->getGrandTotal (),
150+ $ order ->getTaxAmount (),
151+ $ order ->getShippingAmount ()
152152 );
153153
154154 $ result [] = "ga('send', 'pageview'); " ;
@@ -233,18 +233,18 @@ public function getOrdersTrackingData()
233233 $ result ['products ' ][] = [
234234 'id ' => $ this ->escapeJs ($ item ->getSku ()),
235235 'name ' => $ this ->escapeJs ($ item ->getName ()),
236- 'price ' => $ item ->getBasePrice (),
236+ 'price ' => $ item ->getPrice (),
237237 'quantity ' => $ item ->getQtyOrdered (),
238238 ];
239239 }
240240 $ result ['orders ' ][] = [
241241 'id ' => $ order ->getIncrementId (),
242242 'affiliation ' => $ this ->escapeJs ($ this ->_storeManager ->getStore ()->getFrontendName ()),
243- 'revenue ' => $ order ->getBaseGrandTotal (),
244- 'tax ' => $ order ->getBaseTaxAmount (),
245- 'shipping ' => $ order ->getBaseShippingAmount (),
243+ 'revenue ' => $ order ->getGrandTotal (),
244+ 'tax ' => $ order ->getTaxAmount (),
245+ 'shipping ' => $ order ->getShippingAmount (),
246246 ];
247- $ result ['currency ' ] = $ order ->getBaseCurrencyCode ();
247+ $ result ['currency ' ] = $ order ->getOrderCurrencyCode ();
248248 }
249249 return $ result ;
250250 }
0 commit comments