• Magento 2

    Magento2 How to disabled free shipping method at frontend

    Magento2 How to disabled free shipping method at frontend. In this article, I am going to show Magento2 How to disabled free shipping method at frontend. At magento2, it difficult to disable a shipping method at frontend and Enable at admin area. At first, I target to override  Free shipping method class  Magento\OfflineShipping\Model\Carrier\Freeshipping ‘s method  collectRates() using Plugin around method <?php namespace Devamitbera\CoreRewrite\Plugin; /** * Disabled Freeshipping for frontend */ class DisabledFreeShippingForFrontPlugin { protected $appState; public function __construct( \Magento\Framework\App\State $appState ) { $this->appState = $appState; } public function aroundCollectRates( \Magento\OfflineShipping\Model\Carrier\Freeshipping $subject , \Closure $proceed , \Magento\Quote\Model\Quote\Address\RateRequest $request ) { /* If ares is frontend then return false for disable shipping method at frontend */…