A
A
Alexey2021-04-28 20:31:11
WordPress
Alexey, 2021-04-28 20:31:11

How to override woocommerce product card template file?

There is an old WordPress site with a simple informative page directory, news section, etc.
We decided to implement a store on Woocommerce. Everything is fine, but the product card itself on the site looks with a messy layout and there are unnecessary elements. They began to understand and realized that this is a template for news and information pages, located along the path wp-content/themes/theme/single.php
If you make the appropriate changes to it, then the product page becomes normal, but, accordingly, everything becomes bad news pages.
How, what and where can I register so that the wokomers does not refer to this file, but to some other one, for example, single_product.php?
I encountered such a problem for the first time, on other sites, wookomers took its template files as a basis.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Litvinenko, 2021-04-28
@For_Que

add_action( 'after_setup_theme', 'woocommerce_support' );
function woocommerce_support() {
  add_theme_support( 'woocommerce' );
  add_theme_support( 'wc-product-gallery-zoom' );
  add_theme_support( 'wc-product-gallery-lightbox' );
  add_theme_support( 'wc-product-gallery-slider' );
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question