Skip to content

Commit fe6c1dc

Browse files
committed
Merge branch '2.4-develop' of github.com:vo1/magento2 into 2.4-develop-prs
2 parents f6830c2 + 4925c1f commit fe6c1dc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/code/Magento/Shipping/Model/Shipping.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public function collectRates(\Magento\Quote\Model\Quote\Address\RateRequest $req
273273
*/
274274
private function prepareCarrier(string $carrierCode, RateRequest $request): AbstractCarrier
275275
{
276-
$carrier = $this->isShippingCarrierAvailable($carrierCode)
276+
$carrier = $this->isShippingCarrierAvailable($carrierCode, $request->getStoreId())
277277
? $this->_carrierFactory->create($carrierCode, $request->getStoreId())
278278
: null;
279279
if (!$carrier) {
@@ -541,13 +541,15 @@ public function setCarrierAvailabilityConfigField($code = 'active')
541541
* Checks availability of carrier.
542542
*
543543
* @param string $carrierCode
544+
* @param null|int $storeId
544545
* @return bool
545546
*/
546-
private function isShippingCarrierAvailable(string $carrierCode): bool
547+
private function isShippingCarrierAvailable(string $carrierCode, ?int $storeId = null): bool
547548
{
548549
return $this->_scopeConfig->isSetFlag(
549550
'carriers/' . $carrierCode . '/' . $this->_availabilityConfigField,
550-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
551+
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
552+
$storeId
551553
);
552554
}
553555
}

0 commit comments

Comments
 (0)