Hide Flat Rate When Free Shipping Is Active In Magento 2

Posted on Leave a commentPosted in Magento 2

Lets hide Flat Rate when free shipping method is active in magento 2. Assuming you know how to create a module in magento 2 we will just show you how to hide flat rate using plugin. app/code/Vendor/Cart/etc/di.xml <?xml version=”1.0″?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:ObjectManager/etc/config.xsd”> <type name=”Magento\OfflineShipping\Model\Carrier\Flatrate”> <plugin name=”disable-flatrate” type=”Vendor\Cart\Model\Carrier\Flatrate” sortOrder=”1″ /> </type> </config> app/code/Vendor/Cart/Model/Carrier/Flatrate.php <?php namespace DigitalAptech\Cart\Model\Carrier; […]