Check Customer is logged in using knockout js Magento 2

We can use Magento_Customer/js/model/customercomponent to check if the customer is logged in or not in knockout js. Check full component here customer.js We can use isLoggedIn() method. It will return true if customer is loggedIn and return false if customer is not loggedIn Check below code snippet of JS: define([ 'uiComponent', 'Magento_Customer/js/model/customer' ], function (Component,…

Continue Reading Check Customer is logged in using knockout js Magento 2

Work with HTML and JS in Magento 2

During development in Magento 2, we face many issues related to HTML or JS. Sometimes js and HTML changes are not reflected. I often see that many developer run all the commands after doing changes in HTML or JS files. To reflect Html or js changes you don't need to run any command. You even…

Continue Reading Work with HTML and JS in Magento 2