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.
Category: Magento
Open Source lazyLoading Extensions.
magefan s
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 get all the links in customer my account?
create a custom block and write the following code, Vendor\Module_name\Model\Config\Source\Sections then call the blocks on your template file
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
To filter the value which is not equal to in the invoice of Magento
Get the Source Full name from the source code in Magento 2 MSI
We can use Repository \Magento\InventoryApi\Api\SourceRepositoryInterface to get the source by code when we have a source code with us if we want to get the source name we may call a block function to load the source name with the source Id Block Code Phtml File
Set timeout for reloading a page using the script in Magento 2
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.