Enable temporarily disabled admin account

Sometimes our admin account will be disabled when we try several times with the wrong credentials. So to enable this account we could use the commands.php bin/magento admin:user:unlock ADMINUSERNAME Thank you.

Published
Categorized as Magento

How to Get Logged in Customer Data in Magento 2

You can use \Magento\Customer\Model\Session to get the current customer id. First import this class to get the customer session, after this you will be able to get the customer session data. Here is an example how to get the customer id from customer session – Magento 2 Get Current Customer Id Example: <?php namespace Tutorialsplane\HelloWorld\Controller\Index; class Index… Continue reading How to Get Logged in Customer Data in Magento 2

Published
Categorized as Magento

Add google analytics code in magento2

To add google analytics code in Magento2Log in to Magento Backend On the Admin sidebar, go to Stores > Settings > Configuration. In the left panel, expand Sales and choose Google API. Expand  the Google Analytics section and do the following: Set Enable to Yes. Enter your Google Analytics Account Number. If you want to conduct A/B testing and other performance tests on your content, set Content Experiments to Yes. When complete, click Save Config.

Published
Categorized as Magento

Update minicart section after adding a product

whenever we add a product from custom plp page or custom page, auto update to cart is not enabled from magento. Adding the following code to the script will enable auto update of the cart section in any page. This can be also used with ajax call also to update the minicart section after adding… Continue reading Update minicart section after adding a product