Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 3fc107a

Browse files
committed
[BACKPORT] type casted $qty to float in \Magento\Catalog\Model\Product::setQty()
1 parent 11f66c4 commit 3fc107a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/code/Magento/Catalog/Model/Product.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ public function afterSave()
972972
public function setQty($qty)
973973
{
974974
if ($this->getData('qty') != $qty) {
975-
$this->setData('qty', $qty);
975+
$this->setData('qty', (float)$qty);
976976
$this->reloadPriceInfo();
977977
}
978978
return $this;
@@ -985,7 +985,7 @@ public function setQty($qty)
985985
*/
986986
public function getQty()
987987
{
988-
return $this->getData('qty');
988+
return (float)$this->getData('qty');
989989
}
990990

991991
/**

0 commit comments

Comments
 (0)