I am creating a custom theme with my own HTML. I am trying to override woocommerce template. I have created a template named with woocommerce.php but it still shows template with default structure.

I checked the system status and it says that Your theme has a woocommerce.php file, you will not be able to override the woocommerce/archive-product.php custom template since woocommerce.php has priority over archive-product.php. This is intended to prevent display issues.

But when I load the shop page it opens up with default structure.

Some screenshots

  1. Folder Structure
  2. WooCommerece system status
  3. woocommerece.php

2 Answers
2

It’s a custom theme, so first of all you should check if WooCommerce support is declared in the functions.php.

WooCommerce can be integrated with the theme by using woocommerce_content() (woocommerce.php file) or by template overrides, but in both cases the declaration of support in the theme is required.

function wpse319485_add_woocommerce_support() {
    add_theme_support( 'woocommerce' );
}
add_action( 'after_setup_theme', 'wpse319485_add_woocommerce_support' );

Leave a Reply

Your email address will not be published. Required fields are marked *