From 7e754af79ee19ee461c9a47201051d1a87175390 Mon Sep 17 00:00:00 2001 From: Jeroen van Leusden Date: Tue, 22 Jun 2021 14:28:30 +0200 Subject: [PATCH] Add scope when fetching tablerate condition --- Model/Carrier/DpdClassic.php | 6 +++++- Model/Carrier/DpdClassicSaturday.php | 6 +++++- Model/Carrier/DpdExpress10.php | 6 +++++- Model/Carrier/DpdExpress12.php | 6 +++++- Model/Carrier/DpdGuarantee18.php | 6 +++++- Model/Carrier/DpdSaturday.php | 6 +++++- Model/Carrier/Dpdpickup.php | 6 +++++- Model/Carrier/Dpdpredict.php | 6 +++++- 8 files changed, 40 insertions(+), 8 deletions(-) diff --git a/Model/Carrier/DpdClassic.php b/Model/Carrier/DpdClassic.php index 6d61db4..e3fc674 100644 --- a/Model/Carrier/DpdClassic.php +++ b/Model/Carrier/DpdClassic.php @@ -143,7 +143,11 @@ public function collectRates(RateRequest $request) $request->setPackageValue($oldValue - $freePackageValue); } - $conditionName = $this->_scopeConfig->getValue('carriers/dpdclassic/condition_name', \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE); + $conditionName = $this->_scopeConfig->getValue( + 'carriers/dpdclassic/condition_name', + \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE, + $request->getWebsiteId() + ); $request->setConditionName($conditionName ? $conditionName : $this->_defaultConditionName); // Package weight and qty free shipping diff --git a/Model/Carrier/DpdClassicSaturday.php b/Model/Carrier/DpdClassicSaturday.php index 457a1ed..cd2218f 100644 --- a/Model/Carrier/DpdClassicSaturday.php +++ b/Model/Carrier/DpdClassicSaturday.php @@ -203,7 +203,11 @@ public function collectRates(RateRequest $request) $request->setPackageValue($oldValue - $freePackageValue); } - $conditionName = $this->_scopeConfig->getValue('carriers/dpdclassicsaturday/condition_name', \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE); + $conditionName = $this->_scopeConfig->getValue( + 'carriers/dpdclassicsaturday/condition_name', + \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE, + $request->getWebsiteId() + ); $request->setConditionName($conditionName ? $conditionName : $this->_defaultConditionName); // Package weight and qty free shipping diff --git a/Model/Carrier/DpdExpress10.php b/Model/Carrier/DpdExpress10.php index 630071a..d687322 100644 --- a/Model/Carrier/DpdExpress10.php +++ b/Model/Carrier/DpdExpress10.php @@ -145,7 +145,11 @@ public function collectRates(RateRequest $request) $request->setPackageValue($oldValue - $freePackageValue); } - $conditionName = $this->_scopeConfig->getValue('carriers/dpdexpress10/condition_name', \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE); + $conditionName = $this->_scopeConfig->getValue( + 'carriers/dpdexpress10/condition_name', + \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE, + $request->getWebsiteId() + ); $request->setConditionName($conditionName ? $conditionName : $this->_defaultConditionName); // Package weight and qty free shipping diff --git a/Model/Carrier/DpdExpress12.php b/Model/Carrier/DpdExpress12.php index 873272d..d3868c7 100644 --- a/Model/Carrier/DpdExpress12.php +++ b/Model/Carrier/DpdExpress12.php @@ -144,7 +144,11 @@ public function collectRates(RateRequest $request) $request->setPackageValue($oldValue - $freePackageValue); } - $conditionName = $this->_scopeConfig->getValue('carriers/dpdexpress12/condition_name', \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE); + $conditionName = $this->_scopeConfig->getValue( + 'carriers/dpdexpress12/condition_name', + \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE, + $request->getWebsiteId() + ); $request->setConditionName($conditionName ? $conditionName : $this->_defaultConditionName); // Package weight and qty free shipping diff --git a/Model/Carrier/DpdGuarantee18.php b/Model/Carrier/DpdGuarantee18.php index 871f368..71967fc 100644 --- a/Model/Carrier/DpdGuarantee18.php +++ b/Model/Carrier/DpdGuarantee18.php @@ -144,7 +144,11 @@ public function collectRates(RateRequest $request) $request->setPackageValue($oldValue - $freePackageValue); } - $conditionName = $this->_scopeConfig->getValue('carriers/dpdguarantee18/condition_name', \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE); + $conditionName = $this->_scopeConfig->getValue( + 'carriers/dpdguarantee18/condition_name', + \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE, + $request->getWebsiteId() + ); $request->setConditionName($conditionName ? $conditionName : $this->_defaultConditionName); // Package weight and qty free shipping diff --git a/Model/Carrier/DpdSaturday.php b/Model/Carrier/DpdSaturday.php index dca45d2..1eef8c0 100644 --- a/Model/Carrier/DpdSaturday.php +++ b/Model/Carrier/DpdSaturday.php @@ -179,7 +179,11 @@ public function collectRates(RateRequest $request) $request->setPackageValue($oldValue - $freePackageValue); } - $conditionName = $this->_scopeConfig->getValue('carriers/dpdsaturday/condition_name', \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE); + $conditionName = $this->_scopeConfig->getValue( + 'carriers/dpdsaturday/condition_name', + \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE, + $request->getWebsiteId() + ); $request->setConditionName($conditionName ? $conditionName : $this->_defaultConditionName); // Package weight and qty free shipping diff --git a/Model/Carrier/Dpdpickup.php b/Model/Carrier/Dpdpickup.php index 76f8513..a184c74 100644 --- a/Model/Carrier/Dpdpickup.php +++ b/Model/Carrier/Dpdpickup.php @@ -144,7 +144,11 @@ public function collectRates(RateRequest $request) $request->setPackageValue($oldValue - $freePackageValue); } - $conditionName = $this->_scopeConfig->getValue('carriers/dpdpickup/condition_name', \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE); + $conditionName = $this->_scopeConfig->getValue( + 'carriers/dpdpickup/condition_name', + \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE, + $request->getWebsiteId() + ); $request->setConditionName($conditionName ? $conditionName : $this->_defaultConditionName); // Package weight and qty free shipping diff --git a/Model/Carrier/Dpdpredict.php b/Model/Carrier/Dpdpredict.php index 080b57b..90d9c1b 100644 --- a/Model/Carrier/Dpdpredict.php +++ b/Model/Carrier/Dpdpredict.php @@ -143,7 +143,11 @@ public function collectRates(RateRequest $request) $request->setPackageValue($oldValue - $freePackageValue); } - $conditionName = $this->_scopeConfig->getValue('carriers/dpdpredict/condition_name', \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE); + $conditionName = $this->_scopeConfig->getValue( + 'carriers/dpdpredict/condition_name', + \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE, + $request->getWebsiteId() + ); $request->setConditionName($conditionName ? $conditionName : $this->_defaultConditionName); // Package weight and qty free shipping