@@ -120,7 +120,7 @@ public function getOrdersTrackingCode()
120
120
$ result [] = "ga('require', 'ec', 'ec.js'); " ;
121
121
122
122
foreach ($ collection as $ order ) {
123
- $ result [] = "ga('set', 'currencyCode', ' " . $ order ->getBaseCurrencyCode () . "'); " ;
123
+ $ result [] = "ga('set', 'currencyCode', ' " . $ order ->getOrderCurrencyCode () . "'); " ;
124
124
foreach ($ order ->getAllVisibleItems () as $ item ) {
125
125
$ result [] = sprintf (
126
126
"ga('ec:addProduct', {
@@ -131,7 +131,7 @@ public function getOrdersTrackingCode()
131
131
}); " ,
132
132
$ this ->escapeJs ($ item ->getSku ()),
133
133
$ this ->escapeJs ($ item ->getName ()),
134
- $ item ->getBasePrice (),
134
+ $ item ->getPrice (),
135
135
$ item ->getQtyOrdered ()
136
136
);
137
137
}
@@ -146,9 +146,9 @@ public function getOrdersTrackingCode()
146
146
}); " ,
147
147
$ order ->getIncrementId (),
148
148
$ this ->escapeJs ($ this ->_storeManager ->getStore ()->getFrontendName ()),
149
- $ order ->getBaseGrandTotal (),
150
- $ order ->getBaseTaxAmount (),
151
- $ order ->getBaseShippingAmount ()
149
+ $ order ->getGrandTotal (),
150
+ $ order ->getTaxAmount (),
151
+ $ order ->getShippingAmount ()
152
152
);
153
153
154
154
$ result [] = "ga('send', 'pageview'); " ;
@@ -233,18 +233,18 @@ public function getOrdersTrackingData()
233
233
$ result ['products ' ][] = [
234
234
'id ' => $ this ->escapeJs ($ item ->getSku ()),
235
235
'name ' => $ this ->escapeJs ($ item ->getName ()),
236
- 'price ' => $ item ->getBasePrice (),
236
+ 'price ' => $ item ->getPrice (),
237
237
'quantity ' => $ item ->getQtyOrdered (),
238
238
];
239
239
}
240
240
$ result ['orders ' ][] = [
241
241
'id ' => $ order ->getIncrementId (),
242
242
'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 (),
246
246
];
247
- $ result ['currency ' ] = $ order ->getBaseCurrencyCode ();
247
+ $ result ['currency ' ] = $ order ->getOrderCurrencyCode ();
248
248
}
249
249
return $ result ;
250
250
}
0 commit comments