Magento 2: Hide other shipping methods when free shipping is available The 2019 Stack Overflow...

Deal with toxic manager when you can't quit

Is an up-to-date browser secure on an out-of-date OS?

What is the closest word meaning "respect for time / mindful"

What does Linus Torvalds mean when he says that Git "never ever" tracks a file?

Identify This Plant (Flower)

Are children permitted to help build the Beis Hamikdash?

I see my dog run

Why is the maximum length of OpenWrt’s root password 8 characters?

How to support a colleague who finds meetings extremely tiring?

Is there a symbol for a right arrow with a square in the middle?

Resizing object distorts it (Illustrator CC 2018)

Write faster on AT24C32

Are there incongruent pythagorean triangles with the same perimeter and same area?

What tool would a Roman-age civilization have for the breaking of silver and other metals into dust?

Apparent duplicates between Haynes service instructions and MOT

Is bread bad for ducks?

What is the motivation for a law requiring 2 parties to consent for recording a conversation

Can a flute soloist sit?

Loose spokes after only a few rides

Earliest use of the term "Galois extension"?

What do hard-Brexiteers want with respect to the Irish border?

Am I thawing this London Broil safely?

How to manage monthly salary

What did it mean to "align" a radio?



Magento 2: Hide other shipping methods when free shipping is available



The 2019 Stack Overflow Developer Survey Results Are InHow can I hide a shipping option if that option is available as flat-rate or free?Hide shipping method when another availableMagento hide flat rate on orders over x.xxIn magento how to add flat price for shipping outside the default countryHide/disable standard shipping when qualified for free shippingCan't remove Free ShippingFree Shipping not workingMagento 2 Free Shipping options showing all the time in cart pageHow can i hide flat rate shipping method when free shipping is available in magento 2.1.5?Need to override Free shipping method





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







7















I charge my customers flat rate for shipping and I also offer free shipping for orders that are above certain amount. At the moment, customers who qualify for free shipping will also have paid shipping option shown, which may confuse some customers. Does anyone know if there's a way to hide other shipping methods when free shipping method is available?










share|improve this question





























    7















    I charge my customers flat rate for shipping and I also offer free shipping for orders that are above certain amount. At the moment, customers who qualify for free shipping will also have paid shipping option shown, which may confuse some customers. Does anyone know if there's a way to hide other shipping methods when free shipping method is available?










    share|improve this question

























      7












      7








      7


      3






      I charge my customers flat rate for shipping and I also offer free shipping for orders that are above certain amount. At the moment, customers who qualify for free shipping will also have paid shipping option shown, which may confuse some customers. Does anyone know if there's a way to hide other shipping methods when free shipping method is available?










      share|improve this question














      I charge my customers flat rate for shipping and I also offer free shipping for orders that are above certain amount. At the moment, customers who qualify for free shipping will also have paid shipping option shown, which may confuse some customers. Does anyone know if there's a way to hide other shipping methods when free shipping method is available?







      magento2 shipping shipping-methods free-shipping






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 24 '16 at 7:26









      ifekifek

      3815




      3815






















          4 Answers
          4






          active

          oldest

          votes


















          2














          I had the same problem.



          Remove "Free Shipping" configuration because you don't need it (you already have "Cart Price Rules").



          When your customer qualifies for free shipping it happens based on "Flat Rate" not in "Free Shipping".






          share|improve this answer































            4














            Use the extension ShippingTweaks.






            share|improve this answer































              3














              Write a plugin to disable flat rate shipping method when free shipping is actually enabled based on cart sub total.



              <?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="MagentoOfflineShippingModelCarrierFlatrate">
              <plugin name="disable-flatrate" type="VendorModuleNameModelCarrierFlatrate" sortOrder="1" />
              </type>
              </config>


              Write a Model class to process sub total validation.



              <?php
              namespace VendorModuleNameModelCarrier;

              class Flatrate
              {

              const XML_PATH_FREE_SHIPPING_SUBTOTAL = "carriers/freeshipping/free_shipping_subtotal";

              /**
              * @var MagentoCheckoutModelSession
              */
              protected $_checkoutSession;

              /**
              * @var MagentoFrameworkAppConfigScopeConfigInterface
              */
              protected $_scopeConfig;

              public function __construct(
              MagentoCheckoutModelSession $checkoutSession,
              MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
              MagentoStoreModelStoreManagerInterface $storeManager
              ) {
              $this->_storeManager = $storeManager;
              $this->_checkoutSession = $checkoutSession;
              $this->_scopeConfig = $scopeConfig;
              }

              public function afterCollectRates(MagentoOfflineShippingModelCarrierFlatrate $flatRate, $result)
              {
              $scopeId = $this->_storeManager->getStore()->getId();

              $storeScope = MagentoStoreModelScopeInterface::SCOPE_STORES;

              // Get MOA value from system configuration.
              $freeShippingSubTotal = $this->_scopeConfig->getValue(self::XML_PATH_FREE_SHIPPING_SUBTOTAL, $storeScope, $scopeId);

              // Get cart subtotal from checkout session.
              $baseSubTotal = $this->_checkoutSession->getQuote()->getBaseSubtotal();

              // Validate subtoal should be empty or Zero.
              if(!empty($baseSubTotal) && !empty($freeShippingSubTotal)) {

              if($baseSubTotal >= $freeShippingSubTotal) {
              return false;
              }
              }

              return $result;
              }
              }





              share|improve this answer
























              • hi @maniprakash where i need to create di.xml ?

                – Nagaraju Kasa
                Oct 30 '18 at 11:36






              • 1





                Romba nandri its working fine.

                – Nagaraju Kasa
                Oct 30 '18 at 13:26



















              0














              in response to @Nagaraju and hoping to help to anyone.



              The di.xml can be created in any module you have, or if you dont know how and where:



              app/code/My_Vendor/MyModule/etc/di.xml -> here is where you put the code of @maniprakash



              then you should create the class in:



              app/code/My_Vendor/MyModule/Model/Flatrate -> and paste the class code of @maniprakash



              Just remember to change the path in type tag on the di.xml



              <plugin name="disable-flatrate" type="VendorModuleNameModelCarrierFlatrate" sortOrder="1" />


              the path must match where your Model class is it. in my example should be



              <plugin name="disable-flatrate" type="My_VendorMyModuleModelFlatrate" sortOrder="1" />


              AND that's it! hope it helps! and thanks to @manipakrash , it helps me! =)





              share








              New contributor




              Joshua Castro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.





















                Your Answer








                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "479"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: false,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: null,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f103175%2fmagento-2-hide-other-shipping-methods-when-free-shipping-is-available%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                4 Answers
                4






                active

                oldest

                votes








                4 Answers
                4






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                2














                I had the same problem.



                Remove "Free Shipping" configuration because you don't need it (you already have "Cart Price Rules").



                When your customer qualifies for free shipping it happens based on "Flat Rate" not in "Free Shipping".






                share|improve this answer




























                  2














                  I had the same problem.



                  Remove "Free Shipping" configuration because you don't need it (you already have "Cart Price Rules").



                  When your customer qualifies for free shipping it happens based on "Flat Rate" not in "Free Shipping".






                  share|improve this answer


























                    2












                    2








                    2







                    I had the same problem.



                    Remove "Free Shipping" configuration because you don't need it (you already have "Cart Price Rules").



                    When your customer qualifies for free shipping it happens based on "Flat Rate" not in "Free Shipping".






                    share|improve this answer













                    I had the same problem.



                    Remove "Free Shipping" configuration because you don't need it (you already have "Cart Price Rules").



                    When your customer qualifies for free shipping it happens based on "Flat Rate" not in "Free Shipping".







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 21 '17 at 0:05









                    Gabriel SilvaGabriel Silva

                    1047




                    1047

























                        4














                        Use the extension ShippingTweaks.






                        share|improve this answer




























                          4














                          Use the extension ShippingTweaks.






                          share|improve this answer


























                            4












                            4








                            4







                            Use the extension ShippingTweaks.






                            share|improve this answer













                            Use the extension ShippingTweaks.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Aug 28 '17 at 13:21









                            VitaliiVitalii

                            393139




                            393139























                                3














                                Write a plugin to disable flat rate shipping method when free shipping is actually enabled based on cart sub total.



                                <?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="MagentoOfflineShippingModelCarrierFlatrate">
                                <plugin name="disable-flatrate" type="VendorModuleNameModelCarrierFlatrate" sortOrder="1" />
                                </type>
                                </config>


                                Write a Model class to process sub total validation.



                                <?php
                                namespace VendorModuleNameModelCarrier;

                                class Flatrate
                                {

                                const XML_PATH_FREE_SHIPPING_SUBTOTAL = "carriers/freeshipping/free_shipping_subtotal";

                                /**
                                * @var MagentoCheckoutModelSession
                                */
                                protected $_checkoutSession;

                                /**
                                * @var MagentoFrameworkAppConfigScopeConfigInterface
                                */
                                protected $_scopeConfig;

                                public function __construct(
                                MagentoCheckoutModelSession $checkoutSession,
                                MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
                                MagentoStoreModelStoreManagerInterface $storeManager
                                ) {
                                $this->_storeManager = $storeManager;
                                $this->_checkoutSession = $checkoutSession;
                                $this->_scopeConfig = $scopeConfig;
                                }

                                public function afterCollectRates(MagentoOfflineShippingModelCarrierFlatrate $flatRate, $result)
                                {
                                $scopeId = $this->_storeManager->getStore()->getId();

                                $storeScope = MagentoStoreModelScopeInterface::SCOPE_STORES;

                                // Get MOA value from system configuration.
                                $freeShippingSubTotal = $this->_scopeConfig->getValue(self::XML_PATH_FREE_SHIPPING_SUBTOTAL, $storeScope, $scopeId);

                                // Get cart subtotal from checkout session.
                                $baseSubTotal = $this->_checkoutSession->getQuote()->getBaseSubtotal();

                                // Validate subtoal should be empty or Zero.
                                if(!empty($baseSubTotal) && !empty($freeShippingSubTotal)) {

                                if($baseSubTotal >= $freeShippingSubTotal) {
                                return false;
                                }
                                }

                                return $result;
                                }
                                }





                                share|improve this answer
























                                • hi @maniprakash where i need to create di.xml ?

                                  – Nagaraju Kasa
                                  Oct 30 '18 at 11:36






                                • 1





                                  Romba nandri its working fine.

                                  – Nagaraju Kasa
                                  Oct 30 '18 at 13:26
















                                3














                                Write a plugin to disable flat rate shipping method when free shipping is actually enabled based on cart sub total.



                                <?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="MagentoOfflineShippingModelCarrierFlatrate">
                                <plugin name="disable-flatrate" type="VendorModuleNameModelCarrierFlatrate" sortOrder="1" />
                                </type>
                                </config>


                                Write a Model class to process sub total validation.



                                <?php
                                namespace VendorModuleNameModelCarrier;

                                class Flatrate
                                {

                                const XML_PATH_FREE_SHIPPING_SUBTOTAL = "carriers/freeshipping/free_shipping_subtotal";

                                /**
                                * @var MagentoCheckoutModelSession
                                */
                                protected $_checkoutSession;

                                /**
                                * @var MagentoFrameworkAppConfigScopeConfigInterface
                                */
                                protected $_scopeConfig;

                                public function __construct(
                                MagentoCheckoutModelSession $checkoutSession,
                                MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
                                MagentoStoreModelStoreManagerInterface $storeManager
                                ) {
                                $this->_storeManager = $storeManager;
                                $this->_checkoutSession = $checkoutSession;
                                $this->_scopeConfig = $scopeConfig;
                                }

                                public function afterCollectRates(MagentoOfflineShippingModelCarrierFlatrate $flatRate, $result)
                                {
                                $scopeId = $this->_storeManager->getStore()->getId();

                                $storeScope = MagentoStoreModelScopeInterface::SCOPE_STORES;

                                // Get MOA value from system configuration.
                                $freeShippingSubTotal = $this->_scopeConfig->getValue(self::XML_PATH_FREE_SHIPPING_SUBTOTAL, $storeScope, $scopeId);

                                // Get cart subtotal from checkout session.
                                $baseSubTotal = $this->_checkoutSession->getQuote()->getBaseSubtotal();

                                // Validate subtoal should be empty or Zero.
                                if(!empty($baseSubTotal) && !empty($freeShippingSubTotal)) {

                                if($baseSubTotal >= $freeShippingSubTotal) {
                                return false;
                                }
                                }

                                return $result;
                                }
                                }





                                share|improve this answer
























                                • hi @maniprakash where i need to create di.xml ?

                                  – Nagaraju Kasa
                                  Oct 30 '18 at 11:36






                                • 1





                                  Romba nandri its working fine.

                                  – Nagaraju Kasa
                                  Oct 30 '18 at 13:26














                                3












                                3








                                3







                                Write a plugin to disable flat rate shipping method when free shipping is actually enabled based on cart sub total.



                                <?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="MagentoOfflineShippingModelCarrierFlatrate">
                                <plugin name="disable-flatrate" type="VendorModuleNameModelCarrierFlatrate" sortOrder="1" />
                                </type>
                                </config>


                                Write a Model class to process sub total validation.



                                <?php
                                namespace VendorModuleNameModelCarrier;

                                class Flatrate
                                {

                                const XML_PATH_FREE_SHIPPING_SUBTOTAL = "carriers/freeshipping/free_shipping_subtotal";

                                /**
                                * @var MagentoCheckoutModelSession
                                */
                                protected $_checkoutSession;

                                /**
                                * @var MagentoFrameworkAppConfigScopeConfigInterface
                                */
                                protected $_scopeConfig;

                                public function __construct(
                                MagentoCheckoutModelSession $checkoutSession,
                                MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
                                MagentoStoreModelStoreManagerInterface $storeManager
                                ) {
                                $this->_storeManager = $storeManager;
                                $this->_checkoutSession = $checkoutSession;
                                $this->_scopeConfig = $scopeConfig;
                                }

                                public function afterCollectRates(MagentoOfflineShippingModelCarrierFlatrate $flatRate, $result)
                                {
                                $scopeId = $this->_storeManager->getStore()->getId();

                                $storeScope = MagentoStoreModelScopeInterface::SCOPE_STORES;

                                // Get MOA value from system configuration.
                                $freeShippingSubTotal = $this->_scopeConfig->getValue(self::XML_PATH_FREE_SHIPPING_SUBTOTAL, $storeScope, $scopeId);

                                // Get cart subtotal from checkout session.
                                $baseSubTotal = $this->_checkoutSession->getQuote()->getBaseSubtotal();

                                // Validate subtoal should be empty or Zero.
                                if(!empty($baseSubTotal) && !empty($freeShippingSubTotal)) {

                                if($baseSubTotal >= $freeShippingSubTotal) {
                                return false;
                                }
                                }

                                return $result;
                                }
                                }





                                share|improve this answer













                                Write a plugin to disable flat rate shipping method when free shipping is actually enabled based on cart sub total.



                                <?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="MagentoOfflineShippingModelCarrierFlatrate">
                                <plugin name="disable-flatrate" type="VendorModuleNameModelCarrierFlatrate" sortOrder="1" />
                                </type>
                                </config>


                                Write a Model class to process sub total validation.



                                <?php
                                namespace VendorModuleNameModelCarrier;

                                class Flatrate
                                {

                                const XML_PATH_FREE_SHIPPING_SUBTOTAL = "carriers/freeshipping/free_shipping_subtotal";

                                /**
                                * @var MagentoCheckoutModelSession
                                */
                                protected $_checkoutSession;

                                /**
                                * @var MagentoFrameworkAppConfigScopeConfigInterface
                                */
                                protected $_scopeConfig;

                                public function __construct(
                                MagentoCheckoutModelSession $checkoutSession,
                                MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
                                MagentoStoreModelStoreManagerInterface $storeManager
                                ) {
                                $this->_storeManager = $storeManager;
                                $this->_checkoutSession = $checkoutSession;
                                $this->_scopeConfig = $scopeConfig;
                                }

                                public function afterCollectRates(MagentoOfflineShippingModelCarrierFlatrate $flatRate, $result)
                                {
                                $scopeId = $this->_storeManager->getStore()->getId();

                                $storeScope = MagentoStoreModelScopeInterface::SCOPE_STORES;

                                // Get MOA value from system configuration.
                                $freeShippingSubTotal = $this->_scopeConfig->getValue(self::XML_PATH_FREE_SHIPPING_SUBTOTAL, $storeScope, $scopeId);

                                // Get cart subtotal from checkout session.
                                $baseSubTotal = $this->_checkoutSession->getQuote()->getBaseSubtotal();

                                // Validate subtoal should be empty or Zero.
                                if(!empty($baseSubTotal) && !empty($freeShippingSubTotal)) {

                                if($baseSubTotal >= $freeShippingSubTotal) {
                                return false;
                                }
                                }

                                return $result;
                                }
                                }






                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Aug 28 '17 at 12:22









                                Maniprakash ChinnasamyManiprakash Chinnasamy

                                1537




                                1537













                                • hi @maniprakash where i need to create di.xml ?

                                  – Nagaraju Kasa
                                  Oct 30 '18 at 11:36






                                • 1





                                  Romba nandri its working fine.

                                  – Nagaraju Kasa
                                  Oct 30 '18 at 13:26



















                                • hi @maniprakash where i need to create di.xml ?

                                  – Nagaraju Kasa
                                  Oct 30 '18 at 11:36






                                • 1





                                  Romba nandri its working fine.

                                  – Nagaraju Kasa
                                  Oct 30 '18 at 13:26

















                                hi @maniprakash where i need to create di.xml ?

                                – Nagaraju Kasa
                                Oct 30 '18 at 11:36





                                hi @maniprakash where i need to create di.xml ?

                                – Nagaraju Kasa
                                Oct 30 '18 at 11:36




                                1




                                1





                                Romba nandri its working fine.

                                – Nagaraju Kasa
                                Oct 30 '18 at 13:26





                                Romba nandri its working fine.

                                – Nagaraju Kasa
                                Oct 30 '18 at 13:26











                                0














                                in response to @Nagaraju and hoping to help to anyone.



                                The di.xml can be created in any module you have, or if you dont know how and where:



                                app/code/My_Vendor/MyModule/etc/di.xml -> here is where you put the code of @maniprakash



                                then you should create the class in:



                                app/code/My_Vendor/MyModule/Model/Flatrate -> and paste the class code of @maniprakash



                                Just remember to change the path in type tag on the di.xml



                                <plugin name="disable-flatrate" type="VendorModuleNameModelCarrierFlatrate" sortOrder="1" />


                                the path must match where your Model class is it. in my example should be



                                <plugin name="disable-flatrate" type="My_VendorMyModuleModelFlatrate" sortOrder="1" />


                                AND that's it! hope it helps! and thanks to @manipakrash , it helps me! =)





                                share








                                New contributor




                                Joshua Castro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                Check out our Code of Conduct.

























                                  0














                                  in response to @Nagaraju and hoping to help to anyone.



                                  The di.xml can be created in any module you have, or if you dont know how and where:



                                  app/code/My_Vendor/MyModule/etc/di.xml -> here is where you put the code of @maniprakash



                                  then you should create the class in:



                                  app/code/My_Vendor/MyModule/Model/Flatrate -> and paste the class code of @maniprakash



                                  Just remember to change the path in type tag on the di.xml



                                  <plugin name="disable-flatrate" type="VendorModuleNameModelCarrierFlatrate" sortOrder="1" />


                                  the path must match where your Model class is it. in my example should be



                                  <plugin name="disable-flatrate" type="My_VendorMyModuleModelFlatrate" sortOrder="1" />


                                  AND that's it! hope it helps! and thanks to @manipakrash , it helps me! =)





                                  share








                                  New contributor




                                  Joshua Castro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                  Check out our Code of Conduct.























                                    0












                                    0








                                    0







                                    in response to @Nagaraju and hoping to help to anyone.



                                    The di.xml can be created in any module you have, or if you dont know how and where:



                                    app/code/My_Vendor/MyModule/etc/di.xml -> here is where you put the code of @maniprakash



                                    then you should create the class in:



                                    app/code/My_Vendor/MyModule/Model/Flatrate -> and paste the class code of @maniprakash



                                    Just remember to change the path in type tag on the di.xml



                                    <plugin name="disable-flatrate" type="VendorModuleNameModelCarrierFlatrate" sortOrder="1" />


                                    the path must match where your Model class is it. in my example should be



                                    <plugin name="disable-flatrate" type="My_VendorMyModuleModelFlatrate" sortOrder="1" />


                                    AND that's it! hope it helps! and thanks to @manipakrash , it helps me! =)





                                    share








                                    New contributor




                                    Joshua Castro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.










                                    in response to @Nagaraju and hoping to help to anyone.



                                    The di.xml can be created in any module you have, or if you dont know how and where:



                                    app/code/My_Vendor/MyModule/etc/di.xml -> here is where you put the code of @maniprakash



                                    then you should create the class in:



                                    app/code/My_Vendor/MyModule/Model/Flatrate -> and paste the class code of @maniprakash



                                    Just remember to change the path in type tag on the di.xml



                                    <plugin name="disable-flatrate" type="VendorModuleNameModelCarrierFlatrate" sortOrder="1" />


                                    the path must match where your Model class is it. in my example should be



                                    <plugin name="disable-flatrate" type="My_VendorMyModuleModelFlatrate" sortOrder="1" />


                                    AND that's it! hope it helps! and thanks to @manipakrash , it helps me! =)






                                    share








                                    New contributor




                                    Joshua Castro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.








                                    share


                                    share






                                    New contributor




                                    Joshua Castro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.









                                    answered 2 mins ago









                                    Joshua CastroJoshua Castro

                                    1




                                    1




                                    New contributor




                                    Joshua Castro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.





                                    New contributor





                                    Joshua Castro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.






                                    Joshua Castro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Magento Stack Exchange!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f103175%2fmagento-2-hide-other-shipping-methods-when-free-shipping-is-available%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        迭戈·戈丁...

                                        A phrase ”follow into" in a context The 2019 Stack Overflow Developer Survey Results Are...

                                        1960s short story making fun of James Bond-style spy fiction The 2019 Stack Overflow Developer...