Skip to content

Commit 89ee3f9

Browse files
author
Dmytro Yushkin
committed
MAGETWO-54134: CE module depends on EE code
- Removed plugin
1 parent f7bf43c commit 89ee3f9

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,11 +596,12 @@ protected function _isUSCountry($countyId)
596596
* Check whether girth is allowed for the carrier
597597
*
598598
* @param null|string $countyDest
599+
* @param null|string $carrierMethodCode
599600
* @return bool
600601
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
601602
* @api
602603
*/
603-
public function isGirthAllowed($countyDest = null)
604+
public function isGirthAllowed($countyDest = null, $carrierMethodCode = null)
604605
{
605606
return false;
606607
}

app/code/Magento/Usps/Model/Carrier.php

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88

99
namespace Magento\Usps\Model;
1010

11+
use Magento\Framework\App\ObjectManager;
1112
use Magento\Quote\Model\Quote\Address\RateRequest;
1213
use Magento\Shipping\Helper\Carrier as CarrierHelper;
1314
use Magento\Shipping\Model\Carrier\AbstractCarrierOnline;
1415
use Magento\Shipping\Model\Rate\Result;
1516
use Magento\Framework\Xml\Security;
17+
use Magento\Usps\Helper\Data as DataHelper;
1618

1719
/**
1820
* USPS shipping
@@ -128,6 +130,11 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C
128130
'USERID'
129131
];
130132

133+
/**
134+
* @var DataHelper
135+
*/
136+
private $dataHelper;
137+
131138
/**
132139
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
133140
* @param \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory
@@ -1982,11 +1989,13 @@ public function getDeliveryConfirmationTypes(\Magento\Framework\DataObject $para
19821989
* Check whether girth is allowed for the USPS
19831990
*
19841991
* @param null|string $countyDest
1992+
* @param null|string $carrierMethodCode
19851993
* @return bool
19861994
*/
1987-
public function isGirthAllowed($countyDest = null)
1995+
public function isGirthAllowed($countyDest = null, $carrierMethodCode = null)
19881996
{
1989-
return $this->_isUSCountry($countyDest) ? false : true;
1997+
return $this->_isUSCountry($countyDest)
1998+
&& $this->getDataHelper()->displayGirthValue($carrierMethodCode) ? false : true;
19901999
}
19912000

19922001
/**
@@ -2091,4 +2100,19 @@ protected function filterDebugData($data)
20912100

20922101
return $data;
20932102
}
2103+
2104+
/**
2105+
* Gets Data helper object
2106+
*
2107+
* @return DataHelper
2108+
* @deprecated
2109+
*/
2110+
private function getDataHelper()
2111+
{
2112+
if (!$this->dataHelper) {
2113+
$this->dataHelper = ObjectManager::getInstance()->get(DataHelper::class);
2114+
}
2115+
2116+
return $this->dataHelper;
2117+
}
20942118
}

0 commit comments

Comments
 (0)