D
D
Daniil Vershinin2017-07-06 23:49:13
WordPress
Daniil Vershinin, 2017-07-06 23:49:13

Add. woocommerce template?

My task is to implement a catalog in the format:
-Category name- --product--
--product-- --product-- -Category name- --product-- --product-- --product-- .. Moreover, the goal is not to change the current template (because the IM functions), but to create a type of page template where products are displayed in a special way. (I know how to create a page template in the VI, but I don’t know how to shove WOO here). I will be grateful)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav, 2017-07-07
@stanislav-belichenko

You can create some kind of "special" template for product categories by editing the taxonomy-product_cat.php file. More details in the documentation of WC itself . In short, WC itself does not use the WP template system, it has its own approach to all this. The file I marked above contains some simple code:

if ( ! defined( 'ABSPATH' ) ) {
  exit; // Exit if accessed directly
}

wc_get_template( 'archive-product.php' );

As you might guess, in order to display a special template for special pages, you must write some condition here, which will take the archive-product.php template or others under certain conditions. Interactivity can be added by adding the functionality of the WC itself or a plugin for it, which will add, through a hook, to the WC settings in the admin panel the choice of a particular template for certain pages.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question