1. Home
  2. Knowledge Base
  3. WooCommerce Product Table
  4. Advanced Usage
  5. Adding product tables to the main WooCommerce shop page

Adding product tables to the main WooCommerce shop page

While WooCommerce Product Table is primarily designed to be used on standard WordPress pages, it can also be used on the main WooCommerce shop page by overwriting the relevant template in your theme. If you do this then the product table layout will be used whenever customers visit the main shop page, instead of the usual store layout.

First create a folder called “woocommerce” in your theme or child theme (if it doesn’t already exist). See here for details: https://docs.woocommerce.com/document/template-structure.

Next, download archive-product.php by clicking the link and then upload it to the “woocommerce” folder. E.g:

/wp-content/themes/<my theme>/woocommerce/archive-product.php.

You should then see product tables on your main shop page.

If you inspect this file, you’ll see on line 59 there is an $args array which is passed to the [product_table] shortcode. In this example template, only the columns option is set, but you can add more shortcode options to this array as required. For example, if you wanted to add the sort_by option you would do:

$args = array(
  'columns' => 'image,name,price,add-to-cart',
  'sort_by' => 'name' 
);

Add / edit more shortcode options to suit your requirements (e.g. choosing your columns, setting search filters, etc. – please see our article on Creating Product Tables for instructions).

Was this article helpful?

Related Articles