Skip to content

Commit c2a2362

Browse files
author
Stanislav Idolov
authored
ENGCOM-3148: [Forwardport] add error message in else condition #18507
2 parents a2a29a3 + 87dbab5 commit c2a2362

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,18 @@ public function collectRates(RateRequest $request)
9797
$method->setCost('0.00');
9898

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

0 commit comments

Comments
 (0)