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

Add custom javascript to all pages on your theme

Use custom javascript The best solution to add custom javascript to all pages of your website is to create a javascript module and load it via requireJS. This can be done by creating a requirejs-config.js file in your theme folder with the following content: This file tells requireJS to load a custom.js file located in folder Theme_Vendor/Theme_Name/web/js. Include in that[…]

Read more

How to disable the dropdown in the minicart?

I had a customer that wanted to remove the minicart dropdown and take the visitor directly to the cart page when clicking the cart icon. This can be implemented by overriding the dropdown javascript module via mixin. First create a requirejs-config.js under your theme folder. You can add it inside the Magento_Checkout folder. So, create file Theme_Folder/Theme_Name/Magento_Checkout/requirejs-config.js with the following[…]

Read more

How to make phone number a mandatory field in contact page?

If you want to make the phone number a mandatory field in the contact page you will need to override the form.phtml template file. Copy the form.phtml template file used for your current contact form to the folder Magento_Contact/templates inside your theme’s folder. If your current theme does not have that template file it is inheriting from Magento luma or[…]

Read more

How to change the default sort direction in category pages?

The best way to achieve this is by adding the following lines to the category pages layout file catalog_category_view.xml. This file can be under the Magento_Catalog\layout folder inside your theme folder. These instructions call the setDefaultDirection method in class Toolbar, and pass the value desc or asc to the argument dir. This sets the default sort direction to descending or[…]

Read more

How to change the order of tabs on the Product page?

The best way to implement the order change on the tabs that are displayed on magento’s product page is by extending the product page layout and changing the sort_order attribute for the tab block you want to move. In your theme’s folder (design/frontend/Theme_Vendor/Theme_Name) add (or append to) the file catalog_product_view.xml under the folder Magento_Catalog/layout. Is you already have that file[…]

Read more