Addeventlistener in javascript.

The addEventListener() is an inbuilt function in JavaScript that takes the event to listen for, and a second argument to be called whenever the described event gets fired. Any number of event handlers can be added to a single element without overwriting existing event handlers.

Published
Categorized as Magento

Create my account link dynamically

Here we will learn how to create an account link on my account menu section with a condition. For that, we have to assign the custom block for the navigation code for customer_account.xml code for the custom block –> Vendor/module/Block/Customer/link.php We check a custom condition and print the resultant.

How to Extend Layout in Magento 2

Layout customization includes multiple tasks that help you change any elements in your pages. To customize your layout, create extending and overriding layout files in your custom theme. Just add the next layout file in the layout folder like <folder> —Layout –layout1.xml > layout2.xml For each layout file that is included in the list:Layout handle… Continue reading How to Extend Layout in Magento 2

addFieldToFilter condition

There are many conditions you can use with addFieldToFilter. Examples of conditions are equal, not equal, like, not like, in, not in, null, not null, greater than, less than, greater than equal to, and less than equal to. Equal: eq Now we use equal to filter production collection. Not Equals – neq Now we use… Continue reading addFieldToFilter condition

Published
Categorized as Magento

Query Selector

The querySelector() method returns the first element that matches a CSS selector. To return all matches (not only the first), use the querySelectorAll() instead. Both querySelector() and querySelectorAll() throw a SYNTAX_ERR exception if the selector(s) is invalid.

Published
Categorized as Magento