How do I change the templates in the cart or checkout?

Commerce uses Twig file-based templates for theming of the cart, checkout, and emails. The documentation has more in-depth information, but here's the basics.

  1. Create a new folder under core/components/commerce/templates/ with a name of your choosing*. For example myawesomestore or design2017. The name of this folder is your theme name.
  2. Edit the commerce.theme system setting and set it to the name of your theme.
  3. Locate the template file you wish to edit (for example default/frontend/checkout/cart.twig) and copy it into your own theme folder with the same name and directory structure (for example myawesomestore/frontend/checkout/cart.twig). Only copy the files you've actually changed - not the entire default directory! This way you can keep Commerce upgrades as simple as possible.
  4. Edit your copied template.

Do not copy over all template files, just the ones you have edited.

* It's also possible to place the template folder somewhere else using the commerce.theme_path setting. See the documentation for more detailed information about the possibilities for themes.

Learn more about templating in Commerce in the documentation.

Still need help? Send us an email Send us an email