diff --git a/Model/Carrier/CustomShipping.php b/Model/Carrier/CustomShipping.php index 421e3dfb7c414de999e1bc030653ce29ee73dad5..5a8c8a4a452a2e8a976653ae20934ac5e8c6b9fa 100644 --- a/Model/Carrier/CustomShipping.php +++ b/Model/Carrier/CustomShipping.php @@ -188,11 +188,8 @@ class CustomShipping extends AbstractCarrierOnline implements CarrierInterface */ public function getBaseUrl(): string { - $storeBase = $this->_storeManager->getStore()->getBaseUrl(); - // Strip slashes and http:// or https:// and wwww. from the url leaving just "example.com" - $storeBase = preg_replace('/(http:\/\/|https:\/\/|www\.)/', '', $storeBase); - $storeBase = preg_replace('/(\/)/', '', $storeBase); - return $storeBase; + $storeBaseUrl = $this->_storeManager->getStore()->getBaseUrl(); + return parse_url($storeBaseUrl)["host"]; } /**