Skip to content

Commit 7cb816d

Browse files
committed
MAGETWO-99613: Reverting: [Bakport] Adding product from wishlist not adding to cart showing warning message. #22536
- This reverts commit c62ab93.
1 parent 1f6bf0f commit 7cb816d

File tree

1 file changed

+1
-25
lines changed
  • app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Column

1 file changed

+1
-25
lines changed

app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Column/Cart.php

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,6 @@
1414
*/
1515
class Cart extends \Magento\Wishlist\Block\Customer\Wishlist\Item\Column
1616
{
17-
/**
18-
* @var View
19-
*/
20-
private $productView;
21-
22-
/**
23-
* @param \Magento\Catalog\Block\Product\Context $context
24-
* @param \Magento\Framework\App\Http\Context $httpContext
25-
* @param \Magento\Catalog\Block\Product\View $productView
26-
* @param array $data
27-
*/
28-
public function __construct(
29-
\Magento\Catalog\Block\Product\Context $context,
30-
\Magento\Framework\App\Http\Context $httpContext,
31-
array $data = [],
32-
\Magento\Catalog\Block\Product\View $productView = null
33-
) {
34-
$this->productView = $productView ?:
35-
\Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Catalog\Block\Product\View::class);
36-
parent::__construct($context, $httpContext, $data);
37-
}
38-
3917
/**
4018
* Returns qty to show visually to user
4119
*
@@ -45,9 +23,7 @@ public function __construct(
4523
public function getAddToCartQty(\Magento\Wishlist\Model\Item $item)
4624
{
4725
$qty = $item->getQty();
48-
$qty = $qty < $this->productView->getProductDefaultQty($this->getProductItem())
49-
? $this->productView->getProductDefaultQty($this->getProductItem()) : $qty;
50-
return $qty ?: 1;
26+
return $qty ? $qty : 1;
5127
}
5228

5329
/**

0 commit comments

Comments
 (0)