• 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 [crayon-5bc5be67c2547493121700/]   And defined under  di.xml  at app/code/Devamitbera/CoreRewrite/etc/  and try disable by using Area code [crayon-5bc5be67c254e948264556/]   But this is not working at Magento checkout page. I was going strange as the condition as was not working as excepted. Then, I was started to debug and find that issue is this Magento area.At Checkout page, Magento is…

  • magento2 base url
    Magento 2

    How to get magento2 base url

    How to get magento2 base url. You want to get magento2 base url for your current store then you can follow this post. During your daily work, several time, you need to current store base url  and at Magento 1.x version you can get base url using Mage::getBaseUrl();As Magento2, do not used factory patterns, so the code like  Mage::getBaseUrl();  is not exist by which you can base URL.But at Magento2, you should use StoreManager object  and  using  $this->_storeManager->getStore()->getBaseUrl()  you can get base url. Magento2, use interface, injection of class, that you should  Inject. [crayon-5bc5be67c2e61619948113/] at Model, Resource model, Block, Helper classes for getting base url using below code: [crayon-5bc5be67c2e67391096500/] But this…