Skip to main content

Posts

Showing posts from August, 2023

Disable Hover on main menu and make it work on click

The main menu in an eCommerce website holds significant importance as it serves as the primary navigational tool for users to explore and access various sections, products, and features of the online store. The main menu helps users discover products, services, and content they might not have been aware of. By presenting various categories and sections prominently, the menu can drive users to explore different parts of the website, increasing the chances of making a sale. The style and layout of the main menu contribute to the website's overall aesthetic & attractiveness. Magento essentially makes use of a jQuery menu widget to deliver all of its default features. By default, the menu appears when you mouse over it. I had a requirement in which I needed to open the menu only when the customer clicked. Because we were using Megamenu, and when it opened, it took up half of the screen. And this might be annoying for customers at times.  So to solve this, I have created a JS mixin

Layout Processing Priority

While working in Magento, theme developers need to override the layouts from the core modules. And then the developers using those themes may need to customize them according to their requirements.  Magento always recommends, to ensure stability and secure your customizations from being deleted during the upgrade, not change out-of-the-box module and theme layouts. To make the necessary changes, create extending and overriding layout files in your custom theme or module. When multiple copies of the same layouts are available in a project, developers get confused about the layout's execution. So to understand how the layouts are being processed by the application, see the points below: Layouts from the module's base directory. Then layouts from the module's area directory. If the same layout is customized in multiple modules, then they are merged based on the sequence of modules in the app/etc/config.xml file. Then layouts from the theme's design/frontend/Namespace_Modul

How to add new cart item attribute in SalesRule Conditions?

Promotions play a crucial role in the success of an eCommerce business. They are essential for attracting customers, increasing sales, building brand loyalty, and staying competitive in the online marketplace. Managing promotions in Magento 2 can be done through the built-in promotional tools and features. Magento 2 offers a flexible and powerful promotion system to create various types of promotions like discounts, coupons, free shipping, etc. But there is always a scope for change in the business requirement for creating a promotion, and we are going to discuss more on this requirement. Currently, Magento provides the below conditions on which you can create your promotion rules. But by following the below steps you can manage and learn to add more options to the cart price rule. Step 1: First, we need to add a plugin for class Magento\SalesRule\Model\Rule\Condition\Product. <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&q