Skip to content

Commit 3d13f78

Browse files
add error message in else condition
1 parent daff59a commit 3d13f78

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,20 @@ public function collectRates(RateRequest $request)
9898

9999
$result->append($method);
100100
}
101+
elseif ($this->getConfigData('showmethod'))
102+
{
103+
$error = $this->_rateErrorFactory->create();
104+
$error->setCarrier($this->_code);
105+
$error->setCarrierTitle($this->getConfigData('title'));
106+
$errorMsg = $this->getConfigData('specificerrmsg');
107+
$error->setErrorMessage(
108+
$errorMsg ? $errorMsg : __(
109+
'Sorry, but we can\'t deliver to the destination country with this shipping module.'
110+
)
111+
);
112+
113+
return $error;
114+
}
101115

102116
return $result;
103117
}

0 commit comments

Comments
 (0)