cancel
Showing results for 
Search instead for 
Did you mean: 

Overriding module-tax/view/frontend/web/template/checkout/summary/shipping.html not working

SOLVED

Overriding module-tax/view/frontend/web/template/checkout/summary/shipping.html not working

Hi there,

 

I'm not too familiar with Magento 2 but need to make changes to a template. The Magento install has two sites. In the app/design/frontend/Vendor directory I have three theme folders. One is called Bootstrap which has templates for both sites and from there an 'IBHS' folder and a 'HSS' folder for each individual site.

 

I want to override the shipping.html folder located in module-tax/view/frontend/web/template/checkout/summary/shipping.html. I have copied this file into app/design/frontend/Webfeet/HSS/Magento_Tax/web/template/checkout/summary/shipping.html and made my changes but it doesn't appear to get picked up. I've tried running the upgrade command along with compile and static content deploy whilst clearing the cache.

 

I was just wondering whether someone could shine some light on it?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Overriding module-tax/view/frontend/web/template/checkout/summary/shipping.html not working

Hello @tliesnham 

 

To override the shipping.html file located in the module-tax/view/frontend/web/template/checkout/summary/shipping.html directory, you can follow these steps:

  • Create a new directory named Magento_Tax in your theme's directory under app/design/frontend/<Vendor>/<Theme>/Magento_Tax/web/template/checkout/summary.
  • Copy the original shipping.html file from the module-tax/view/frontend/web/template/checkout/summary/ directory to the new directory you created in step 1.
  • Modify the copied shipping.html file to include the changes you want to make.
  • To ensure that your theme's Magento_Tax directory takes precedence over the module-tax directory, you need to add the following code to your theme's requirejs-config.js file:
    var config = {
        map: {
            '*': {
                'Magento_Tax/template/checkout/summary/shipping.html':
                    'Vendor_Theme/template/checkout/summary/shipping.html'
            }
        }
    };
  • Flush the cache to ensure that the changes take effect.
  •  Note: If your theme does not have a requirejs-config.js file, you will need to create one in the root of your theme's directory.

If you find our reply helpful, please give us kudos.

 

A Leading Magento Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.

 

WebDesk Solution Support Team

Get a Free Quote | | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789

Thank You,


WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789


Location: 150 King St. W. Toronto, ON M5H 1J9

View solution in original post

2 REPLIES 2

Re: Overriding module-tax/view/frontend/web/template/checkout/summary/shipping.html not working

Hello @tliesnham 

 

To override the shipping.html file located in the module-tax/view/frontend/web/template/checkout/summary/shipping.html directory, you can follow these steps:

  • Create a new directory named Magento_Tax in your theme's directory under app/design/frontend/<Vendor>/<Theme>/Magento_Tax/web/template/checkout/summary.
  • Copy the original shipping.html file from the module-tax/view/frontend/web/template/checkout/summary/ directory to the new directory you created in step 1.
  • Modify the copied shipping.html file to include the changes you want to make.
  • To ensure that your theme's Magento_Tax directory takes precedence over the module-tax directory, you need to add the following code to your theme's requirejs-config.js file:
    var config = {
        map: {
            '*': {
                'Magento_Tax/template/checkout/summary/shipping.html':
                    'Vendor_Theme/template/checkout/summary/shipping.html'
            }
        }
    };
  • Flush the cache to ensure that the changes take effect.
  •  Note: If your theme does not have a requirejs-config.js file, you will need to create one in the root of your theme's directory.

If you find our reply helpful, please give us kudos.

 

A Leading Magento Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.

 

WebDesk Solution Support Team

Get a Free Quote | | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789

Thank You,


WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789


Location: 150 King St. W. Toronto, ON M5H 1J9

Re: Overriding module-tax/view/frontend/web/template/checkout/summary/shipping.html not working

Thank you @johnwebdes40a5 it must have been the requirejs-config.js file that I was missing. You have been a great help!