Skip to content

Commit c45b8ee

Browse files
committed
ACP2E-860: The attribute values are storing correctly only if it's 'Show Company' property is 'Optional' for 'Main Website' for Multistore
- Fixed the issue.
1 parent a129d5d commit c45b8ee

File tree

3 files changed

+40
-41
lines changed

3 files changed

+40
-41
lines changed

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,50 @@
66

77
namespace Magento\Sales\Controller\Adminhtml\Order\Create;
88

9+
use Magento\Backend\App\Action\Context;
10+
use Magento\Backend\Model\View\Result\ForwardFactory;
11+
use Magento\Catalog\Helper\Product;
912
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
13+
use Magento\Framework\App\ObjectManager;
14+
use Magento\Framework\Escaper;
1015
use Magento\Framework\Exception\PaymentException;
16+
use Magento\Framework\View\Result\PageFactory;
17+
use Magento\Store\Model\StoreManagerInterface;
1118

1219
class Save extends \Magento\Sales\Controller\Adminhtml\Order\Create implements HttpPostActionInterface
1320
{
21+
/**
22+
* @var StoreManagerInterface
23+
*/
24+
private $storeManager;
25+
26+
/**
27+
* @param Context $context
28+
* @param Product $productHelper
29+
* @param Escaper $escaper
30+
* @param PageFactory $resultPageFactory
31+
* @param ForwardFactory $resultForwardFactory
32+
* @param StoreManagerInterface|null $storeManager
33+
*/
34+
public function __construct(
35+
Context $context,
36+
Product $productHelper,
37+
Escaper $escaper,
38+
PageFactory $resultPageFactory,
39+
ForwardFactory $resultForwardFactory,
40+
StoreManagerInterface $storeManager = null
41+
) {
42+
parent::__construct(
43+
$context,
44+
$productHelper,
45+
$escaper,
46+
$resultPageFactory,
47+
$resultForwardFactory
48+
);
49+
$this->storeManager = $storeManager ?: ObjectManager::getInstance()
50+
->get(StoreManagerInterface::class);
51+
}
52+
1453
/**
1554
* Saving quote and create order
1655
*
@@ -31,6 +70,7 @@ public function execute()
3170
) {
3271
return $this->resultForwardFactory->create()->forward('denied');
3372
}
73+
$this->storeManager->setCurrentStore($this->_getSession()->getQuote()->getStore()->getCode());
3474
$this->_getOrderCreateModel()->getQuote()->setCustomerId($this->_getSession()->getCustomerId());
3575
$this->_processActionData('save');
3676
$paymentData = $this->getRequest()->getPost('payment');

app/code/Magento/Sales/Plugin/Model/Customer/Metadata/AddressMetadata.php

Lines changed: 0 additions & 38 deletions
This file was deleted.

app/code/Magento/Sales/etc/adminhtml/di.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,4 @@
5252
<type name="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
5353
<plugin name="orderGridCollectionFilterPlugin" type="Magento\Sales\Plugin\Model\ResourceModel\Order\OrderGridCollectionFilter"/>
5454
</type>
55-
<type name="Magento\Customer\Model\Metadata\AddressMetadata">
56-
<plugin name="OrderDetailUpdateAddress" type="Magento\Sales\Plugin\Model\Customer\Metadata\AddressMetadata"/>
57-
</type>
5855
</config>

0 commit comments

Comments
 (0)