File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
app/code/Magento/GoogleAnalytics/Block Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -122,8 +122,7 @@ public function getOrdersTrackingCode()
122122 foreach ($ collection as $ order ) {
123123 $ result [] = "ga('set', 'currencyCode', ' " . $ order ->getOrderCurrencyCode () . "'); " ;
124124 foreach ($ order ->getAllVisibleItems () as $ item ) {
125- $ quantity = (float )$ item ->getQtyOrdered ();
126- $ quantity = fmod ($ quantity , 1 ) !== 0.00 ? $ quantity : (int )$ quantity ;
125+ $ quantity = $ item ->getQtyOrdered () * 1 ;
127126 $ format = fmod ($ quantity , 1 ) !== 0.00 ? '%.2f ' : '%d ' ;
128127 $ result [] = sprintf (
129128 "ga('ec:addProduct', {
@@ -237,8 +236,7 @@ public function getOrdersTrackingData()
237236
238237 foreach ($ collection as $ order ) {
239238 foreach ($ order ->getAllVisibleItems () as $ item ) {
240- $ quantity = (float )$ item ->getQtyOrdered ();
241- $ quantity = fmod ($ quantity , 1 ) !== 0.00 ? $ quantity : (int )$ quantity ;
239+ $ quantity = $ item ->getQtyOrdered () * 1 ;
242240 $ result ['products ' ][] = [
243241 'id ' => $ this ->escapeJsQuote ($ item ->getSku ()),
244242 'name ' => $ this ->escapeJsQuote ($ item ->getName ()),
You can’t perform that action at this time.
0 commit comments