File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
app/code/Magento/Checkout/Controller/Cart Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 4
4
* Copyright © Magento, Inc. All rights reserved.
5
5
* See COPYING.txt for license details.
6
6
*/
7
+
7
8
namespace Magento \Checkout \Controller \Cart ;
8
9
9
10
use Magento \Checkout \Model \Cart as CustomerCart ;
11
+ use Magento \Framework \App \Action \HttpPostActionInterface ;
10
12
use Magento \Framework \Escaper ;
11
13
use Magento \Framework \App \ObjectManager ;
12
14
use Magento \Sales \Model \Order \Item ;
13
15
14
16
/**
17
+ * Add grouped items controller.
18
+ *
15
19
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
16
20
*/
17
- class Addgroup extends \Magento \Checkout \Controller \Cart
21
+ class Addgroup extends \Magento \Checkout \Controller \Cart implements HttpPostActionInterface
18
22
{
19
23
/**
20
24
* @var Escaper
@@ -44,6 +48,8 @@ public function __construct(
44
48
}
45
49
46
50
/**
51
+ * Add items in group.
52
+ *
47
53
* @return \Magento\Framework\Controller\Result\Redirect
48
54
*/
49
55
public function execute ()
@@ -74,6 +80,8 @@ public function execute()
74
80
}
75
81
}
76
82
$ this ->cart ->save ();
83
+ } else {
84
+ $ this ->messageManager ->addErrorMessage (__ ('Please select at least one product to add to cart ' ));
77
85
}
78
86
return $ this ->_goBack ();
79
87
}
You can’t perform that action at this time.
0 commit comments