Skip to content

Commit

Permalink
add error message in else condition
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhavahalpara committed Oct 10, 2018
1 parent a474225 commit 9b7d4ac
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,20 @@ public function collectRates(RateRequest $request)

$result->append($method);
}
elseif ($this->getConfigData('showmethod'))
{
$error = $this->_rateErrorFactory->create();
$error->setCarrier($this->_code);
$error->setCarrierTitle($this->getConfigData('title'));
$errorMsg = $this->getConfigData('specificerrmsg');
$error->setErrorMessage(
$errorMsg ? $errorMsg : __(
'Sorry, but we can\'t deliver to the destination country with this shipping module.'
)
);

return $error;
}

return $result;
}
Expand Down

0 comments on commit 9b7d4ac

Please sign in to comment.