0

Is there any way to remove flat are shipping on orders, if their total is above 1000$?

I have to use flat rate on this site aswell, so I cant use the built in way of giving free shipping to orders, as it seems to apply only to normal shipping methods, and not flat rate.

Any help is more than welcome. Thank you!

  • did you found any solution ? – Pawan Oct 15 '18 at 16:38
1

You can do it to override Flate rate model file.

vendor/magento-offline-shipping/Model/Carrier/Flatrate.php

change 79 line to

Old

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

New

if (!$this->getConfigFlag('active') || $request->getPackageValueWithDiscount() > 1000) {
            return false;
        }

*First do directly in vendor after it works then please override model. Don't forgot to override model file.

| improve this answer | |
  • I've updated the code, but now I cant checkout - I cant get past the /checkout/ page, and I dont see any errors, not in console, and no ajax requests are being made. – Bawsi Oct 15 '18 at 7:09
  • I have to remove the handling fee, not the price btw – Bawsi Oct 15 '18 at 7:37
  • Above code works for me fine. maybe you forgot to remove cache – Magento2 Devloper Oct 15 '18 at 8:36
  • above code olny works when your order amount greater then 1000 in cart. – Magento2 Devloper Oct 15 '18 at 8:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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