File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Sales/Controller/Adminhtml/Order Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1620,6 +1620,9 @@ public function addProduct(
1620
1620
$ item = $ this ->getItemByProduct ($ candidate );
1621
1621
if (!$ item ) {
1622
1622
$ item = $ this ->itemProcessor ->init ($ candidate , $ request );
1623
+ $ item ->setQuote ($ this );
1624
+ $ item ->setOptions ($ candidate ->getCustomOptions ());
1625
+ $ item ->setProduct ($ candidate );
1623
1626
// Add only item that is not in quote already
1624
1627
$ this ->addItem ($ item );
1625
1628
}
Original file line number Diff line number Diff line change @@ -71,9 +71,6 @@ public function init(Product $product, $request)
71
71
return $ item ;
72
72
}
73
73
74
- $ item ->setOptions ($ product ->getCustomOptions ());
75
- $ item ->setProduct ($ product );
76
-
77
74
if ($ request ->getResetCount () && !$ product ->getStickWithinParent () && $ item ->getId () === $ request ->getId ()) {
78
75
$ item ->setData (CartItemInterface::KEY_QTY , 0 );
79
76
}
Original file line number Diff line number Diff line change @@ -151,15 +151,15 @@ protected function _processActionData($action = null)
151
151
'session ' => $ this ->_getSession (),
152
152
];
153
153
154
- $ this ->_eventManager ->dispatch ('adminhtml_sales_order_create_process_data_before ' , $ eventData );
155
-
156
154
/**
157
- * Saving order data
155
+ * Import post data, in order to make order quote valid
158
156
*/
159
157
if ($ data = $ this ->getRequest ()->getPost ('order ' )) {
160
158
$ this ->_getOrderCreateModel ()->importPostData ($ data );
161
159
}
162
160
161
+ $ this ->_eventManager ->dispatch ('adminhtml_sales_order_create_process_data_before ' , $ eventData );
162
+
163
163
/**
164
164
* Initialize catalog rule data
165
165
*/
You can’t perform that action at this time.
0 commit comments