File tree Expand file tree Collapse file tree 3 files changed +59
-0
lines changed
Block/Adminhtml/Order/Create Expand file tree Collapse file tree 3 files changed +59
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © 2015 Magento. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ namespace Magento \Bundle \Block \Adminhtml \Order \Create ;
7
+
8
+ class Sidebar
9
+ {
10
+ /**
11
+ * Get item qty
12
+ *
13
+ * @param \Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\AbstractSidebar $subject
14
+ * @param callable $proceed
15
+ * @param \Magento\Framework\DataObject $item
16
+ *
17
+ * @return string
18
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
19
+ */
20
+ public function aroundGetItemQty (
21
+ \Magento \Sales \Block \Adminhtml \Order \Create \Sidebar \AbstractSidebar $ subject ,
22
+ \Closure $ proceed ,
23
+ \Magento \Framework \DataObject $ item
24
+ ) {
25
+ if ($ item ->getProduct ()->getTypeId () == \Magento \Bundle \Model \Product \Type::TYPE_CODE ) {
26
+ return '' ;
27
+ }
28
+ return $ proceed ($ item );
29
+ }
30
+
31
+ /**
32
+ * Check whether product configuration is required before adding to order
33
+ *
34
+ * @param \Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\AbstractSidebar $subject
35
+ * @param callable $proceed
36
+ * @param string $productType
37
+ *
38
+ * @return bool
39
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
40
+ */
41
+ public function aroundIsConfigurationRequired (
42
+ \Magento \Sales \Block \Adminhtml \Order \Create \Sidebar \AbstractSidebar $ subject ,
43
+ \Closure $ proceed ,
44
+ $ productType
45
+ ) {
46
+ if ($ productType == \Magento \Bundle \Model \Product \Type::TYPE_CODE ) {
47
+ return true ;
48
+ }
49
+ return $ proceed ($ productType );
50
+ }
51
+ }
Original file line number Diff line number Diff line change 19
19
*/
20
20
class Type extends \Magento \Catalog \Model \Product \Type \AbstractType
21
21
{
22
+ /**
23
+ * Product type
24
+ */
25
+ const TYPE_CODE = 'bundle ' ;
26
+
22
27
/**
23
28
* Product is composite
24
29
*
Original file line number Diff line number Diff line change 9
9
<type name =" Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper" >
10
10
<plugin name =" Bundle" type =" Magento\Bundle\Controller\Adminhtml\Product\Initialization\Helper\Plugin\Bundle" sortOrder =" 60" />
11
11
</type >
12
+ <type name =" Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\AbstractSidebar" >
13
+ <plugin name =" Bundle" type =" Magento\Bundle\Block\Adminhtml\Order\Create\Sidebar" sortOrder =" 200" />
14
+ </type >
12
15
<type name =" Magento\Catalog\Model\Product\CopyConstructor\Composite" >
13
16
<arguments >
14
17
<argument name =" constructors" xsi : type =" array" >
You can’t perform that action at this time.
0 commit comments