I have installed Check delivery available extension in my website.

Here the options are as follows:

  1. Delivery available
  2. Delivery Not Available.

For Available delivery, We added dummy pin codes. If any user checked delivery with non added pin codes, They will get display a message as Delivery not available.

I have enabled the flat rate option at shipping methods. And want to show for this non delivered products only.

Here, If any product is having the status Delivery Not Available, The shipping method should be Flat rate only.

How to do that?

1 Answer 1


Goto your shipping module to the model file like below:


There is a method name collectRates. You will find something like below code:

if (!$this->getConfigFlag('active')) {
    return false;

You can check your conditions, if you don't want to show the shipping method then return false else true like below:

// Checking if module is enabled or not.
if (!$this->getConfigFlag('active')) {
    return false;

// Your custom condition
    return true;
} else {
    return false;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.