File tree 1 file changed +25
-1
lines changed
app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Column 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 14
14
*/
15
15
class Cart extends \Magento \Wishlist \Block \Customer \Wishlist \Item \Column
16
16
{
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
+
17
39
/**
18
40
* Returns qty to show visually to user
19
41
*
@@ -23,7 +45,9 @@ class Cart extends \Magento\Wishlist\Block\Customer\Wishlist\Item\Column
23
45
public function getAddToCartQty (\Magento \Wishlist \Model \Item $ item )
24
46
{
25
47
$ qty = $ item ->getQty ();
26
- return $ qty ? $ qty : 1 ;
48
+ $ qty = $ qty < $ this ->productView ->getProductDefaultQty ($ this ->getProductItem ())
49
+ ? $ this ->productView ->getProductDefaultQty ($ this ->getProductItem ()) : $ qty ;
50
+ return $ qty ?: 1 ;
27
51
}
28
52
29
53
/**
You can’t perform that action at this time.
0 commit comments