How to make magento mobile menu collapse on all levels

By default, magento mobile menu is set to collapse only at the top level and not on all levels. To overcome this default feature one must override the _toggleMobileMode function that is implemented in the lib\web\mage\menu.js file.Overriding or extending javascript functionality in magento should be done using mixins. A mixin is a class whose methods are added to, or mixed in, with[…]

Read more

Minimize Magento downtime when deploying changes in production mode

Here are a few suggestions to minimize downtime on Magento, whenever you need to deploy changes in production mode. Changes on phtml template files in the child theme(no downtime) All templates are updated in folder var/view_processed (no need to delete it first) Changes in less, css, js files in the child theme(no downtime if css and js are served from[…]

Read more

How to hide/remove the Add to Cart button on magento 2

Sometimes it is useful to remove or hide the Add to Cart button throughout a magento 2 website. An easy way to do this without changing the actual template is by creating a plugin (also called interceptor) to change the isSaleable function that is used on those templates. Here I created the function that will be called after the isSaleable[…]

Read more

How to remove “Estimate shipping costs and tax” block from cart page in magento 2

To remove the “Estimate shipping costs and tax” block from the cart page: #1 Add the following code to checkout_cart_index.xml in your theme (create a new file if it doesn’t exist). The file should be in app/code/design/frontend/<Theme_Vendor>/<Theme_Name>/Magento_Checkout/layout/. #2 Override the template file cart/shipping.phtml in your theme (or module) and remove the following lines Then clear your cache and you are[…]

Read more

How to Disable Magento 2 Reviews And Ratings

You can easily disable magento 2 reviews and ratings functionality directly in the magento backend. Go to Stores > Settings > Configuration. Open the Catalog tab and choose the Catalog option. Navigate to the Product Reviews section and set No in the Enabled field. Save the changes. If you are running a version were you do not have that option then remove[…]

Read more