Overriding Woocommerce templates via a theme

Estimated reading: 1 minute 493 views

WooCommerce template files contain the markup and structure for your store's frontend and HTML emails.

These files include hooks that let you add or move content without editing the template files directly, protecting against upgrade issues by keeping the template files untouched.

You can find the template files in the /woocommerce/templates/ directory.

How to Edit Files

To edit WooCommerce template files in an upgrade-safe way, use overrides. Follow these steps:

  1. Copy the template into a directory within your theme named /woocommerce, maintaining the same file structure but removing the /templates/ subdirectory.
  2. Example: To override the archive page, copy: wp-content/themes/yourtheme/woocommerce/archive-product.php
  3. The copied file will now override the WooCommerce default template file.
  4. Open the copied archive-product.php file and edit it.
  5. Delete the woocommerce_shop_loop and paste your table shortcode in its place.

Example

echo do_shortcode("[Product_Table id='104' name='test']");

Share this Doc

Overriding Woocommerce templates via a theme

Or copy link

CONTENTS