Hi i have use a plugin feature in my module to check the zipcode is available in the module or not .Which works fine but on validating i have set the error message like
$result = $connection->fetchAll("SELECT shipregioncodes FROM shipregioncodes_shipregioncodes WHERE shipregioncodes=$postcode");
$count = count($result);
if($count==0){
$this->_messageManager->addError("hiiiiiiii");
throw new NoSuchEntityException(
__('Shipping is not available on provided zipcode %1', $postcode)
);
}
it only shows the message in the console not on the site.Please suggest me how can i fix this. thanks
Hi i got this done by using the below code using StateException
don't forget to include
:)