-
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
magento2 get base url and media url and static url
March 24, 2016How to get magento2 base url
June 29, 2017Magento 2 import email address to Newsletter from csv
September 28, 2017