File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed
app/code/Magento/ConfigurableProduct
Block/Adminhtml/Order/Create Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © 2016 Magento. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ namespace Magento \ConfigurableProduct \Block \Adminhtml \Order \Create ;
7
+
8
+ use Magento \ConfigurableProduct \Model \Product \Type \Configurable ;
9
+
10
+ class Sidebar
11
+ {
12
+ /**
13
+ * Get item qty
14
+ *
15
+ * @param \Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\AbstractSidebar $subject
16
+ * @param \Closure $proceed
17
+ * @param \Magento\Framework\DataObject $item
18
+ * @return string
19
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
20
+ */
21
+ public function aroundGetItemQty (
22
+ \Magento \Sales \Block \Adminhtml \Order \Create \Sidebar \AbstractSidebar $ subject ,
23
+ \Closure $ proceed ,
24
+ \Magento \Framework \DataObject $ item
25
+ ) {
26
+ if ($ item ->getProduct ()->getTypeId () == Configurable::TYPE_CODE ) {
27
+ return '' ;
28
+ }
29
+ return $ proceed ($ item );
30
+ }
31
+
32
+ /**
33
+ * Check whether product configuration is required before adding to order
34
+ *
35
+ * @param \Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\AbstractSidebar $subject
36
+ * @param \Closure $proceed
37
+ * @param string $productType
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 == Configurable::TYPE_CODE ) {
47
+ return true ;
48
+ }
49
+ return $ proceed ($ productType );
50
+ }
51
+ }
Original file line number Diff line number Diff line change 16
16
<type name =" Magento\Catalog\Model\Product\Validator" >
17
17
<plugin name =" configurable" type =" Magento\ConfigurableProduct\Model\Product\Validator\Plugin" sortOrder =" 50" />
18
18
</type >
19
+ <type name =" Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\AbstractSidebar" >
20
+ <plugin name =" configurable" type =" Magento\ConfigurableProduct\Block\Adminhtml\Order\Create\Sidebar" sortOrder =" 200" />
21
+ </type >
19
22
<type name =" Magento\ConfigurableProduct\Block\Adminhtml\Product\Attribute\Edit\Tab\Variations\Main" >
20
23
<arguments >
21
24
<argument name =" inputTypeFactory" xsi : type =" object" >Magento\Catalog\Model\System\Config\Source\InputtypeFactory</argument >
You can’t perform that action at this time.
0 commit comments