-
Magento2 How to disabled free shipping method at frontend
June 29, 2017 /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 */…
You May Also Like
How to get magento2 base url
June 29, 2017Magento2 add a cms page link to menu
April 18, 2018Magento2 Checkout shipping address autofill
March 23, 2019