wnsy
wnsy

Reputation: 11

WooCommerce not including template single-product.php

I am developing my WooCommerce theme (hereinafter referred to as WC). WC does not see the single-product.php template, and load index.php instead. At the same time, on the catalog page, the custom archive-products.php is loaded.

Guys, neither custom nor original single-product.php is loaded. Tell me, please, what to do?

I did:

  1. Create woocommerce directory in theme folder
  2. Inside mytheme/woocommerce I placed custom archive-products.php and single-product.php
  3. I added WC support in functions.php. I checked the support in the site admin panel - everything is ok.

Upvotes: 0

Views: 1758

Answers (1)

theboss_dev
theboss_dev

Reputation: 1196

Check the directory again and make sure the file name is correct. it must be archive-product.php Not archive-products.php.

It's better if you copy the plugin template file in your theme directory then modify it.

Example: To override the archive-product.php, copy: wp-content/plugins/woocommerce/templates/archive-product.php to wp-content/themes/yourtheme/woocommerce/archive-product.php

Reference: https://woocommerce.com/document/template-structure/#how-to-edit-files

Upvotes: 0

Related Questions