1. Home
  2. Documentation
  3. WooCommerce Product Table
  4. Product Table Shortcode Options
  5. Product table links

Product table links

WooCommerce Product Table lets you choose what happens when someone clicks on an item in the table.

The links option controls which columns in the product table appear as plain text or as clickable hyperlinks.

By default, the following columns are formatted as links: sku, idnamecategoriestags, attributes, and any custom taxonomy. If you disable the Image Lightbox option then the image column will also be hyperlinked.

Clicking on an ID, SKU, product name or image will take the user to the single product page.

Clicking on a category, tag, custom taxonomy term or attribute will filter the table to that value. However, you can change this behavior using the search on click option below.

WooCommerce product table default links

Product table with all clickable columns added to the table and formatted as links.

You can control which columns are clickable by setting the Links option globally on the plugin settings page, or adding the links option directly to the product table shortcode.

Links option on plugin settings page

On the plugin settings page, either add all to show links for all clickable columns, false to disable all links, or add a comma separated list of the specific columns that you want to make clickable. For example, in this screenshot, the categories and tags columns will be clickable:

WooCommerce product table links options

Setting links in the shortcode

  • Use links="all" to make all possible links in the table clickable. This is the default.
  • Use links="none" or links="false" to disable all links. This is useful if you want to create a one-page order form or product catalog, with no way for customers to access the single product page.
  • You can also use any combination of the following keywords, as a comma-separated list. The description in brackets denotes where the item will link to:
    • id – The ID column (single product page)
    • sku – The SKU column will be clickable (single product page)
    • image – The image column (single product page – see note above about image lightbox)
    • name – The product name column (single product page)
    • categories – The categories column (category archive page)
    • tags – The tags column (tag archive page)
    • terms – Any custom taxonomy column (taxonomy archive page)
    • attributes – Any product attribute column (attribute archive page)

Examples:

  • [product_table columns="image,name,att:colour,att:size" links="image,name,attributes"]
  • [product_table columns="sku,name,tax:my_taxonomy,price" links="sku,terms"]
  • [product_table columns="sku,image,name,categories,price" links="none"]

Search on click

By default, clicking on the categories and tags columns in the table will search (i.e. filter) the table by that category or tag. This is a quick way of filtering the table if you have lots of products.

You can disable this search_on_click feature so that when someone clicks on a category, tag, attribute or custom taxonomy term, then they will be taken to the relevant category/tag archive instead. This must be done directly in the shortcode.

Example:  [product_table columns="name,categories,tags" search_on_click="false"]

Tip: This option will only work correctly if your theme includes archive pages for categories/tags/attributes/custom taxonomy terms.

The Links option described above controls the links to the single product page which are added automatically. If you prefer, you can manually add links to any other location such as an external URL or enquiry form. Please see our article about how to do this.

Was this article helpful?

Related Articles