Skip to content

Commit 0b39225

Browse files
author
Sergii Kovalenko
committed
MAGETWO-71613: [AP: New Order] Tier-prices are not applied on add complex product by SKU
1 parent 4d9d6b0 commit 0b39225

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

app/code/Magento/Quote/Model/Quote.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,6 +1620,9 @@ public function addProduct(
16201620
$item = $this->getItemByProduct($candidate);
16211621
if (!$item) {
16221622
$item = $this->itemProcessor->init($candidate, $request);
1623+
$item->setQuote($this);
1624+
$item->setOptions($candidate->getCustomOptions());
1625+
$item->setProduct($candidate);
16231626
// Add only item that is not in quote already
16241627
$this->addItem($item);
16251628
}

app/code/Magento/Quote/Model/Quote/Item/Processor.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ public function init(Product $product, $request)
7171
return $item;
7272
}
7373

74-
$item->setOptions($product->getCustomOptions());
75-
$item->setProduct($product);
76-
7774
if ($request->getResetCount() && !$product->getStickWithinParent() && $item->getId() === $request->getId()) {
7875
$item->setData(CartItemInterface::KEY_QTY, 0);
7976
}

app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,15 @@ protected function _processActionData($action = null)
151151
'session' => $this->_getSession(),
152152
];
153153

154-
$this->_eventManager->dispatch('adminhtml_sales_order_create_process_data_before', $eventData);
155-
156154
/**
157-
* Saving order data
155+
* Import post data, in order to make order quote valid
158156
*/
159157
if ($data = $this->getRequest()->getPost('order')) {
160158
$this->_getOrderCreateModel()->importPostData($data);
161159
}
162160

161+
$this->_eventManager->dispatch('adminhtml_sales_order_create_process_data_before', $eventData);
162+
163163
/**
164164
* Initialize catalog rule data
165165
*/

0 commit comments

Comments
 (0)