Skip to content

Commit 2ad1031

Browse files
committed
type casted $qty to float in \Magento\Catalog\Model\Product::getQty()
1 parent 76676ce commit 2ad1031

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
@@ -958,7 +958,7 @@ public function afterSave()
958958
public function setQty($qty)
959959
{
960960
if ($this->getData('qty') != $qty) {
961-
$this->setData('qty', (float)$qty);
961+
$this->setData('qty', $qty);
962962
$this->reloadPriceInfo();
963963
}
964964
return $this;
@@ -971,7 +971,7 @@ public function setQty($qty)
971971
*/
972972
public function getQty()
973973
{
974-
return $this->getData('qty');
974+
return (float)$this->getData('qty');
975975
}
976976

977977
/**

0 commit comments

Comments
 (0)