Skip to content

Commit b35b681

Browse files
committed
MAGETWO-91702: Shipping method Table Rates settings gets from wrong store
- Get store id from quote for shipping rates
1 parent 8fd89cf commit b35b681

File tree

1 file changed

+43
-47
lines changed

1 file changed

+43
-47
lines changed

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

Lines changed: 43 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,7 @@ public function collectShippingRates()
965965

966966
/**
967967
* Request shipping rates for entire address or specified address item
968+
*
968969
* Returns true if current selected shipping method code corresponds to one of the found rates
969970
*
970971
* @param \Magento\Quote\Model\Quote\Item\AbstractItem $item
@@ -1002,7 +1003,7 @@ public function requestShippingRates(\Magento\Quote\Model\Quote\Item\AbstractIte
10021003
/**
10031004
* Store and website identifiers specified from StoreManager
10041005
*/
1005-
$request->setStoreId($this->storeManager->getStore()->getId());
1006+
$request->setStoreId($this->getQuote()->getStoreId() ?? $this->storeManager->getStore()->getId());
10061007
$request->setWebsiteId($this->storeManager->getWebsite()->getId());
10071008
$request->setFreeShipping($this->getFreeShipping());
10081009
/**
@@ -1348,31 +1349,31 @@ public function getAllBaseTotalAmounts()
13481349
/******************************* End Total Collector Interface *******************************************/
13491350

13501351
/**
1351-
* {@inheritdoc}
1352+
* @inheritdoc
13521353
*/
13531354
protected function _getValidationRulesBeforeSave()
13541355
{
13551356
return $this->validator;
13561357
}
13571358

13581359
/**
1359-
* {@inheritdoc}
1360+
* @inheritdoc
13601361
*/
13611362
public function getCountryId()
13621363
{
13631364
return $this->getData(self::KEY_COUNTRY_ID);
13641365
}
13651366

13661367
/**
1367-
* {@inheritdoc}
1368+
* @inheritdoc
13681369
*/
13691370
public function setCountryId($countryId)
13701371
{
13711372
return $this->setData(self::KEY_COUNTRY_ID, $countryId);
13721373
}
13731374

13741375
/**
1375-
* {@inheritdoc}
1376+
* @inheritdoc
13761377
*/
13771378
public function getStreet()
13781379
{
@@ -1381,207 +1382,207 @@ public function getStreet()
13811382
}
13821383

13831384
/**
1384-
* {@inheritdoc}
1385+
* @inheritdoc
13851386
*/
13861387
public function setStreet($street)
13871388
{
13881389
return $this->setData(self::KEY_STREET, $street);
13891390
}
13901391

13911392
/**
1392-
* {@inheritdoc}
1393+
* @inheritdoc
13931394
*/
13941395
public function getCompany()
13951396
{
13961397
return $this->getData(self::KEY_COMPANY);
13971398
}
13981399

13991400
/**
1400-
* {@inheritdoc}
1401+
* @inheritdoc
14011402
*/
14021403
public function setCompany($company)
14031404
{
14041405
return $this->setData(self::KEY_COMPANY, $company);
14051406
}
14061407

14071408
/**
1408-
* {@inheritdoc}
1409+
* @inheritdoc
14091410
*/
14101411
public function getTelephone()
14111412
{
14121413
return $this->getData(self::KEY_TELEPHONE);
14131414
}
14141415

14151416
/**
1416-
* {@inheritdoc}
1417+
* @inheritdoc
14171418
*/
14181419
public function setTelephone($telephone)
14191420
{
14201421
return $this->setData(self::KEY_TELEPHONE, $telephone);
14211422
}
14221423

14231424
/**
1424-
* {@inheritdoc}
1425+
* @inheritdoc
14251426
*/
14261427
public function getFax()
14271428
{
14281429
return $this->getData(self::KEY_FAX);
14291430
}
14301431

14311432
/**
1432-
* {@inheritdoc}
1433+
* @inheritdoc
14331434
*/
14341435
public function setFax($fax)
14351436
{
14361437
return $this->setData(self::KEY_FAX, $fax);
14371438
}
14381439

14391440
/**
1440-
* {@inheritdoc}
1441+
* @inheritdoc
14411442
*/
14421443
public function getPostcode()
14431444
{
14441445
return $this->getData(self::KEY_POSTCODE);
14451446
}
14461447

14471448
/**
1448-
* {@inheritdoc}
1449+
* @inheritdoc
14491450
*/
14501451
public function setPostcode($postcode)
14511452
{
14521453
return $this->setData(self::KEY_POSTCODE, $postcode);
14531454
}
14541455

14551456
/**
1456-
* {@inheritdoc}
1457+
* @inheritdoc
14571458
*/
14581459
public function getCity()
14591460
{
14601461
return $this->getData(self::KEY_CITY);
14611462
}
14621463

14631464
/**
1464-
* {@inheritdoc}
1465+
* @inheritdoc
14651466
*/
14661467
public function setCity($city)
14671468
{
14681469
return $this->setData(self::KEY_CITY, $city);
14691470
}
14701471

14711472
/**
1472-
* {@inheritdoc}
1473+
* @inheritdoc
14731474
*/
14741475
public function getFirstname()
14751476
{
14761477
return $this->getData(self::KEY_FIRSTNAME);
14771478
}
14781479

14791480
/**
1480-
* {@inheritdoc}
1481+
* @inheritdoc
14811482
*/
14821483
public function setFirstname($firstname)
14831484
{
14841485
return $this->setData(self::KEY_FIRSTNAME, $firstname);
14851486
}
14861487

14871488
/**
1488-
* {@inheritdoc}
1489+
* @inheritdoc
14891490
*/
14901491
public function getLastname()
14911492
{
14921493
return $this->getData(self::KEY_LASTNAME);
14931494
}
14941495

14951496
/**
1496-
* {@inheritdoc}
1497+
* @inheritdoc
14971498
*/
14981499
public function setLastname($lastname)
14991500
{
15001501
return $this->setData(self::KEY_LASTNAME, $lastname);
15011502
}
15021503

15031504
/**
1504-
* {@inheritdoc}
1505+
* @inheritdoc
15051506
*/
15061507
public function getMiddlename()
15071508
{
15081509
return $this->getData(self::KEY_MIDDLENAME);
15091510
}
15101511

15111512
/**
1512-
* {@inheritdoc}
1513+
* @inheritdoc
15131514
*/
15141515
public function setMiddlename($middlename)
15151516
{
15161517
return $this->setData(self::KEY_MIDDLENAME, $middlename);
15171518
}
15181519

15191520
/**
1520-
* {@inheritdoc}
1521+
* @inheritdoc
15211522
*/
15221523
public function getPrefix()
15231524
{
15241525
return $this->getData(self::KEY_PREFIX);
15251526
}
15261527

15271528
/**
1528-
* {@inheritdoc}
1529+
* @inheritdoc
15291530
*/
15301531
public function setPrefix($prefix)
15311532
{
15321533
return $this->setData(self::KEY_PREFIX, $prefix);
15331534
}
15341535

15351536
/**
1536-
* {@inheritdoc}
1537+
* @inheritdoc
15371538
*/
15381539
public function getSuffix()
15391540
{
15401541
return $this->getData(self::KEY_SUFFIX);
15411542
}
15421543

15431544
/**
1544-
* {@inheritdoc}
1545+
* @inheritdoc
15451546
*/
15461547
public function setSuffix($suffix)
15471548
{
15481549
return $this->setData(self::KEY_SUFFIX, $suffix);
15491550
}
15501551

15511552
/**
1552-
* {@inheritdoc}
1553+
* @inheritdoc
15531554
*/
15541555
public function getVatId()
15551556
{
15561557
return $this->getData(self::KEY_VAT_ID);
15571558
}
15581559

15591560
/**
1560-
* {@inheritdoc}
1561+
* @inheritdoc
15611562
*/
15621563
public function setVatId($vatId)
15631564
{
15641565
return $this->setData(self::KEY_VAT_ID, $vatId);
15651566
}
15661567

15671568
/**
1568-
* {@inheritdoc}
1569+
* @inheritdoc
15691570
*/
15701571
public function getCustomerId()
15711572
{
15721573
return $this->getData(self::KEY_CUSTOMER_ID);
15731574
}
15741575

15751576
/**
1576-
* {@inheritdoc}
1577+
* @inheritdoc
15771578
*/
15781579
public function setCustomerId($customerId)
15791580
{
15801581
return $this->setData(self::KEY_CUSTOMER_ID, $customerId);
15811582
}
15821583

15831584
/**
1584-
* {@inheritdoc}
1585+
* @inheritdoc
15851586
*/
15861587
public function getEmail()
15871588
{
@@ -1594,63 +1595,63 @@ public function getEmail()
15941595
}
15951596

15961597
/**
1597-
* {@inheritdoc}
1598+
* @inheritdoc
15981599
*/
15991600
public function setEmail($email)
16001601
{
16011602
return $this->setData(self::KEY_EMAIL, $email);
16021603
}
16031604

16041605
/**
1605-
* {@inheritdoc}
1606+
* @inheritdoc
16061607
*/
16071608
public function setRegion($region)
16081609
{
16091610
return $this->setData(self::KEY_REGION, $region);
16101611
}
16111612

16121613
/**
1613-
* {@inheritdoc}
1614+
* @inheritdoc
16141615
*/
16151616
public function setRegionId($regionId)
16161617
{
16171618
return $this->setData(self::KEY_REGION_ID, $regionId);
16181619
}
16191620

16201621
/**
1621-
* {@inheritdoc}
1622+
* @inheritdoc
16221623
*/
16231624
public function setRegionCode($regionCode)
16241625
{
16251626
return $this->setData(self::KEY_REGION_CODE, $regionCode);
16261627
}
16271628

16281629
/**
1629-
* {@inheritdoc}
1630+
* @inheritdoc
16301631
*/
16311632
public function getSameAsBilling()
16321633
{
16331634
return $this->getData(self::SAME_AS_BILLING);
16341635
}
16351636

16361637
/**
1637-
* {@inheritdoc}
1638+
* @inheritdoc
16381639
*/
16391640
public function setSameAsBilling($sameAsBilling)
16401641
{
16411642
return $this->setData(self::SAME_AS_BILLING, $sameAsBilling);
16421643
}
16431644

16441645
/**
1645-
* {@inheritdoc}
1646+
* @inheritdoc
16461647
*/
16471648
public function getCustomerAddressId()
16481649
{
16491650
return $this->getData(self::CUSTOMER_ADDRESS_ID);
16501651
}
16511652

16521653
/**
1653-
* {@inheritdoc}
1654+
* @inheritdoc
16541655
*/
16551656
public function setCustomerAddressId($customerAddressId)
16561657
{
@@ -1681,20 +1682,15 @@ public function setSaveInAddressBook($saveInAddressBook)
16811682
//@codeCoverageIgnoreEnd
16821683

16831684
/**
1684-
* {@inheritdoc}
1685-
*
1686-
* @return \Magento\Quote\Api\Data\AddressExtensionInterface|null
1685+
* @inheritdoc
16871686
*/
16881687
public function getExtensionAttributes()
16891688
{
16901689
return $this->_getExtensionAttributes();
16911690
}
16921691

16931692
/**
1694-
* {@inheritdoc}
1695-
*
1696-
* @param \Magento\Quote\Api\Data\AddressExtensionInterface $extensionAttributes
1697-
* @return $this
1693+
* @inheritdoc
16981694
*/
16991695
public function setExtensionAttributes(\Magento\Quote\Api\Data\AddressExtensionInterface $extensionAttributes)
17001696
{
@@ -1712,7 +1708,7 @@ public function getShippingMethod()
17121708
}
17131709

17141710
/**
1715-
* {@inheritdoc}
1711+
* @inheritdoc
17161712
*/
17171713
protected function getCustomAttributesCodes()
17181714
{

0 commit comments

Comments
 (0)