Check Customer isLogged in using knockout js magento 2.

You can check the customer is logged in or using knockout javascript in Magento 2 by using the Magento_Customer/js/model/customer class.

customer.js file used to check customer is logged in or not.

Customer Js file contains the method isLoggedIn() to detect customer login status. Continue reading “Check Customer isLogged in using knockout js magento 2.”

How to Run Javascript after KnockoutJS has rendered all elements in a page magento 2?

Magento uses knockout js at many places in the code. You can see Checkout page data render using knockout js in Magento 2. To custom requirement, You need to execute some javascript code after knockout js load completely.

If you are using require([“jquery”, “domReady!”], function($){} function or jQuery(window).load() function, Using this way mostly your custom javascript code execute before the knockout element render.
Continue reading “How to Run Javascript after KnockoutJS has rendered all elements in a page magento 2?”