@@ -124,8 +124,8 @@ public function getOrdersTrackingCode()
124
124
"ga('ec:addProduct', {
125
125
'id': '%s',
126
126
'name': '%s',
127
- 'price': '%s ',
128
- 'quantity': %s
127
+ 'price': '%f ',
128
+ 'quantity': %d
129
129
}); " ,
130
130
$ this ->escapeJsQuote ($ item ->getSku ()),
131
131
$ this ->escapeJsQuote ($ item ->getName ()),
@@ -138,9 +138,9 @@ public function getOrdersTrackingCode()
138
138
"ga('ec:setAction', 'purchase', {
139
139
'id': '%s',
140
140
'affiliation': '%s',
141
- 'revenue': '%s ',
142
- 'tax': '%s ',
143
- 'shipping': '%s '
141
+ 'revenue': '%f ',
142
+ 'tax': '%f ',
143
+ 'shipping': '%f '
144
144
}); " ,
145
145
$ order ->getIncrementId (),
146
146
$ this ->escapeJsQuote ($ this ->_storeManager ->getStore ()->getFrontendName ()),
@@ -235,16 +235,16 @@ public function getOrdersTrackingData()
235
235
$ result ['products ' ][] = [
236
236
'id ' => $ this ->escapeJsQuote ($ item ->getSku ()),
237
237
'name ' => $ this ->escapeJsQuote ($ item ->getName ()),
238
- 'price ' => $ item ->getPrice (),
239
- 'quantity ' => $ item ->getQtyOrdered (),
238
+ 'price ' => ( float ) $ item ->getPrice (),
239
+ 'quantity ' => ( int ) $ item ->getQtyOrdered (),
240
240
];
241
241
}
242
242
$ result ['orders ' ][] = [
243
243
'id ' => $ order ->getIncrementId (),
244
244
'affiliation ' => $ this ->escapeJsQuote ($ this ->_storeManager ->getStore ()->getFrontendName ()),
245
- 'revenue ' => $ order ->getGrandTotal (),
246
- 'tax ' => $ order ->getTaxAmount (),
247
- 'shipping ' => $ order ->getShippingAmount (),
245
+ 'revenue ' => ( float ) $ order ->getGrandTotal (),
246
+ 'tax ' => ( float ) $ order ->getTaxAmount (),
247
+ 'shipping ' => ( float ) $ order ->getShippingAmount (),
248
248
];
249
249
$ result ['currency ' ] = $ order ->getOrderCurrencyCode ();
250
250
}
0 commit comments