Skip to content

Commit 1a9e35c

Browse files
authored
ENGCOM-3515: Multishipping Checkout Store id is saved NULL in sales_order_item Table: FIXED #19321
2 parents ecfb349 + b080902 commit 1a9e35c

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
use Magento\Quote\Model\Quote;
99

1010
/**
11+
* Quote item model.
12+
*
1113
* @api
1214
* @method int getParentItemId()
1315
* @method \Magento\Quote\Model\Quote\Address\Item setParentItemId(int $value)
@@ -46,6 +48,8 @@
4648
* @method \Magento\Quote\Model\Quote\Address\Item setSuperProductId(int $value)
4749
* @method int getParentProductId()
4850
* @method \Magento\Quote\Model\Quote\Address\Item setParentProductId(int $value)
51+
* @method int getStoreId()
52+
* @method \Magento\Quote\Model\Quote\Address\Item setStoreId(int $value)
4953
* @method string getSku()
5054
* @method \Magento\Quote\Model\Quote\Address\Item setSku(string $value)
5155
* @method string getImage()
@@ -101,15 +105,15 @@ class Item extends \Magento\Quote\Model\Quote\Item\AbstractItem
101105
protected $_quote;
102106

103107
/**
104-
* @return void
108+
* @inheritdoc
105109
*/
106110
protected function _construct()
107111
{
108112
$this->_init(\Magento\Quote\Model\ResourceModel\Quote\Address\Item::class);
109113
}
110114

111115
/**
112-
* @return $this|\Magento\Quote\Model\Quote\Item\AbstractItem
116+
* @inheritdoc
113117
*/
114118
public function beforeSave()
115119
{
@@ -154,6 +158,8 @@ public function getQuote()
154158
}
155159

156160
/**
161+
* Import quote item.
162+
*
157163
* @param \Magento\Quote\Model\Quote\Item $quoteItem
158164
* @return $this
159165
*/
@@ -168,6 +174,8 @@ public function importQuoteItem(\Magento\Quote\Model\Quote\Item $quoteItem)
168174
$quoteItem->getProductId()
169175
)->setProduct(
170176
$quoteItem->getProduct()
177+
)->setStoreId(
178+
$quoteItem->getStoreId()
171179
)->setSku(
172180
$quoteItem->getSku()
173181
)->setName(
@@ -190,10 +198,9 @@ public function importQuoteItem(\Magento\Quote\Model\Quote\Item $quoteItem)
190198
}
191199

192200
/**
193-
* @param string $code
194-
* @return \Magento\Catalog\Model\Product\Configuration\Item\Option\OptionInterface|null
201+
* @inheritdoc
195202
*/
196-
public function getOptionBycode($code)
203+
public function getOptionByCode($code)
197204
{
198205
if ($this->getQuoteItem()) {
199206
return $this->getQuoteItem()->getOptionBycode($code);

app/code/Magento/Quote/etc/db_schema.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@
352352
comment="Super Product Id"/>
353353
<column xsi:type="int" name="parent_product_id" padding="10" unsigned="true" nullable="true" identity="false"
354354
comment="Parent Product Id"/>
355+
<column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="true" identity="false"
356+
comment="Store Id"/>
355357
<column xsi:type="varchar" name="sku" nullable="true" length="255" comment="Sku"/>
356358
<column xsi:type="varchar" name="image" nullable="true" length="255" comment="Image"/>
357359
<column xsi:type="varchar" name="name" nullable="true" length="255" comment="Name"/>
@@ -403,6 +405,9 @@
403405
<index referenceId="QUOTE_ADDRESS_ITEM_QUOTE_ITEM_ID" indexType="btree">
404406
<column name="quote_item_id"/>
405407
</index>
408+
<index referenceId="QUOTE_ADDRESS_ITEM_STORE_ID" indexType="btree">
409+
<column name="store_id"/>
410+
</index>
406411
</table>
407412
<table name="quote_item_option" resource="checkout" engine="innodb" comment="Sales Flat Quote Item Option">
408413
<column xsi:type="int" name="option_id" padding="10" unsigned="true" nullable="false" identity="true"

app/code/Magento/Quote/etc/db_schema_whitelist.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@
212212
"product_id": true,
213213
"super_product_id": true,
214214
"parent_product_id": true,
215+
"store_id": true,
215216
"sku": true,
216217
"image": true,
217218
"name": true,
@@ -233,7 +234,8 @@
233234
"index": {
234235
"QUOTE_ADDRESS_ITEM_QUOTE_ADDRESS_ID": true,
235236
"QUOTE_ADDRESS_ITEM_PARENT_ITEM_ID": true,
236-
"QUOTE_ADDRESS_ITEM_QUOTE_ITEM_ID": true
237+
"QUOTE_ADDRESS_ITEM_QUOTE_ITEM_ID": true,
238+
"QUOTE_ADDRESS_ITEM_STORE_ID": true
237239
},
238240
"constraint": {
239241
"PRIMARY": true,

0 commit comments

Comments
 (0)