$ pincode = $ this->getRequest()->getParam('p', false); $ id = $ this->getRequest()->getParam('id', false); $ collection = $ this->resultPageFactory->create(); $ collection = $ this->getCollection(); $ collection->addFieldToFilter('pincode', array('eq' => $ pincode)); $ codData = $ collection->getData(); if($ codData[0]['pincode'] != '' && $ codData[0]['cod'] != ''){ echo '<span class="cod-suc">Delivery Available'; if($ codData[0]['days'] != ''){ $ final = ' within '.$ codData[0]['days'].' days <br>'.$ codData[0]['cod'].' '; } echo '.</span>'; }else{ $ final = '<span class="cod-error">Delivery Not Available</span>'; }
it always gives this error
Fatal error: Uncaught Error: Call to undefined method Pradeep\PincodeChecker\Controller\Index\Index\Interceptor::getCollection()