WOOT - WooCommerce Active Products Tables

How to overload archive products template to display products table instead?

You should create child WordPress theme firstly if you not have one!

  • in file functions.php add next code:
    add_action('after_setup_theme', function(){
        add_theme_support('woocommerce');
    });
    
  • in child theme create new folder ‘woocommerce‘ if not exists one
  • ¬†copy file ‘wp-content\plugins\woocommerce\templates\archive-product.php‘ to just created folder ‘woocommerce
  • open copied file ‘archive-product.php
  • add there next code after code ‘if (woocommerce_product_loop()) {
    global $wp_query;
    $cat = $wp_query->get_queried_object();
    if (is_object($cat) AND isset($cat->term_id) AND $cat->term_id > 0) {
         $conditions = json_encode([
              'by_taxonomy' => "{$cat->taxonomy}:{$cat->term_id}|rel:AND"
          ]);
         echo do_shortcode("[woot id=1 predefinition='{$conditions}']");
    }
    

  • code started from ‘woocommerce_product_loop_start();‘ to ‘woocommerce_product_loop_end();‘ remove, including them self

See example: https://demo.products-tables.com/product-category/shoes/sneakers/

Download file archive-product.php as an example