@@ -237,19 +237,21 @@ public function getOrdersTrackingData()
237
237
238
238
foreach ($ collection as $ order ) {
239
239
foreach ($ order ->getAllVisibleItems () as $ item ) {
240
+ $ quantity = (float )$ item ->getQtyOrdered ();
241
+ $ quantity = fmod ($ quantity , 1 ) !== 0.00 ? $ quantity : (int )$ quantity ;
240
242
$ result ['products ' ][] = [
241
243
'id ' => $ this ->escapeJsQuote ($ item ->getSku ()),
242
244
'name ' => $ this ->escapeJsQuote ($ item ->getName ()),
243
- 'price ' => round (( float )$ item ->getPrice (), 2 ),
244
- 'quantity ' => ( int ) $ item -> getQtyOrdered () ,
245
+ 'price ' => ( float )$ item ->getPrice (),
246
+ 'quantity ' => $ quantity ,
245
247
];
246
248
}
247
249
$ result ['orders ' ][] = [
248
250
'id ' => $ order ->getIncrementId (),
249
251
'affiliation ' => $ this ->escapeJsQuote ($ this ->_storeManager ->getStore ()->getFrontendName ()),
250
- 'revenue ' => round (( float )$ order ->getGrandTotal (), 2 ),
251
- 'tax ' => round (( float )$ order ->getTaxAmount (), 2 ),
252
- 'shipping ' => round (( float )$ order ->getShippingAmount (), 2 )
252
+ 'revenue ' => ( float )$ order ->getGrandTotal (),
253
+ 'tax ' => ( float )$ order ->getTaxAmount (),
254
+ 'shipping ' => ( float )$ order ->getShippingAmount (),
253
255
];
254
256
$ result ['currency ' ] = $ order ->getOrderCurrencyCode ();
255
257
}
0 commit comments