@@ -237,19 +237,21 @@ public function getOrdersTrackingData()
237237
238238 foreach ($ collection as $ order ) {
239239 foreach ($ order ->getAllVisibleItems () as $ item ) {
240+ $ quantity = (float )$ item ->getQtyOrdered ();
241+ $ quantity = fmod ($ quantity , 1 ) !== 0.00 ? $ quantity : (int )$ quantity ;
240242 $ result ['products ' ][] = [
241243 'id ' => $ this ->escapeJsQuote ($ item ->getSku ()),
242244 '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 ,
245247 ];
246248 }
247249 $ result ['orders ' ][] = [
248250 'id ' => $ order ->getIncrementId (),
249251 '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 (),
253255 ];
254256 $ result ['currency ' ] = $ order ->getOrderCurrencyCode ();
255257 }
0 commit comments