Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions app/code/Magento/Catalog/Block/Product/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,13 @@ public function isStartCustomization()
*/
public function getProductDefaultQty($product = null)
{
if (!$product) {
$product = $this->getProduct();
}
$product = $product ?: $this->getProduct();

$qty = max((float) $this->getMinimalQty($product), 1);

$qty = $this->getMinimalQty($product);
$config = $product->getPreconfiguredValues();
$configQty = $config->getQty();
if ($configQty > $qty) {
$qty = $configQty;
$configQty = $product->getPreconfiguredValues()->getQty();
if (is_numeric($configQty)) {
$qty = max($qty, (float) $configQty);
}

return $qty;
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Wishlist/Plugin/Helper/Product/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function beforePrepareAndRender(
$params = null
) {
$qty = $controller->getRequest()->getParam('qty');
if ($qty) {
if ($qty && is_numeric($qty)) {
if (null === $params || !$params instanceof DataObject) {
$params = new DataObject((array) $params);
}
Expand Down