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()
122
122
foreach ($ collection as $ order ) {
123
123
$ result [] = "ga('set', 'currencyCode', ' " . $ order ->getOrderCurrencyCode () . "'); " ;
124
124
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 ;
127
126
$ format = fmod ($ quantity , 1 ) !== 0.00 ? '%.2f ' : '%d ' ;
128
127
$ result [] = sprintf (
129
128
"ga('ec:addProduct', {
@@ -237,8 +236,7 @@ public function getOrdersTrackingData()
237
236
238
237
foreach ($ collection as $ order ) {
239
238
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 ;
242
240
$ result ['products ' ][] = [
243
241
'id ' => $ this ->escapeJsQuote ($ item ->getSku ()),
244
242
'name ' => $ this ->escapeJsQuote ($ item ->getName ()),
You can’t perform that action at this time.
0 commit comments