Product table columns
WooCommerce Product Table gives you full control over the data displayed in the table. You can do this using the
The available columns are:
add-to-cart . You can also add columns for any product attribute, custom field or custom taxonomy term.
You can choose as many columns as you want and in any order. You must separate each column with a comma. It doesn’t matter if there are spaces before or after the comma.
Here’s an example displaying the product name, categories, stock level, price and add to cart button:
namecolumns are self-explanatory. The
idcolumn is the product ID, assigned by WordPress when you create the product.
descriptioncolumn will show the full product description, shown under the “Description” tab on the product page. The description is truncated to 15 words but you can customise this using the
short-descriptioncolumn will display the Product Short Description entered on the Edit Product screen. The is normally displayed on your product page just before the price and add to cart button.
datecolumn will display the date that the product was added to your store (i.e. when it was published).
tagscolumns display the list of categories/tags that the product is in. You can use the
linksoption to control whether or not these columns will link to the relevant category or tag. If
search_on_clickis enabled then clicking on the category or tag in the table will filter the table to products in that category/tag.
imagecolumn will display the main product image (see the
image_sizeoption below to set a custom size).
reviewscolumn will display the average star rating out of 5 for each product, based on previous customer reviews.
stockcolumn will show the current stock level for the product. There are various settings in WooCommerce which control how the stock level is displayed (see WooCommerce > Settings > Products > Inventory), and this column will change based on these settings.
dimensionscolumns will display the relevant data as entered for each product under the Shipping tab.
pricecolumn will display the current product price. If there are variations for the product then the price is displayed as a range – e.g. “$2.99 – 5.99”. If the product is currently on sale, then the sale price is shown with the original price crossed out next to it.
add-to-cartcolumn will display the Add to Cart button for that product. You can use the
show_quantityoption to show or hide the quantity field (default is to hide the quantity field). You can also show product variations.
Product attribute columns
You can display any product attribute as a separate column in the table using the format
att:<attribute name>. Here’s an example with columns for the attributes
You need to use the attribute “slug” here, which can be found under the Products -> Attributes menu in the WordPress admin.
If you want to show a custom product attribute (i.e. an attribute added just for one product), use the attribute name you entered on the Attributes tab for that product.
Custom field columns
You can also add custom fields to your table using the format
cf:<field name>. If you are using Advanced Custom Fields, the field name can be found under the “Field Name” column in the Custom Fields menu. Here’s an example adding two custom fields –
Custom fields are an opportunity to include other types of content in the table. You can use them to store various data such as links, buttons, icons and shortcodes from other plugins. You will need to add the full HTML code or shortcode to the custom field so that the product table can display it correctly. If you’re using shortcodes, you will need to set shortcodes to true.
Custom fields created using the Toolset Types plugin
If you’re using Toolset Types to create your custom fields, then you need slightly different syntax to display them in the product table.
wpcf- to the start of the custom field name, so if you create a custom field called ‘link’ (for example) then the correct syntax will be
wpcf-link. This means that if you want to create a product table with columns for name and a custom field called ‘link’ then you would need to add it as follows:
Custom taxonomy columns
To add taxonomies to your table (other than product categories and tags), use the format
tax:<taxonomy slug> in the columns option. So, for example, to display for a custom taxonomy with the slug
document_type, you would use:
You can find the taxonomy slug by going to the WordPress admin and finding the page which lists the taxonomy terms. For example, WooCommerce product categories are edited under the Products -> Categories menu. On that page, the URL at the top of the screen shows “…edit-tags.php?taxonomy=product_cat….” The ‘product_cat’ part after the equals (=) is the taxonomy slug you need to use.
Choosing your own column headings
You can set custom column headings by adding a : (colon) after the column name. You can add custom headings for any column in the table. If you don’t set one then the default heading will be used.
For example, the default heading for the product name is “Name”, but if you wanted the heading “Product Name” instead, you would use:
[product_table columns="name:Product Name,date,price"]
Example using several custom headings:
[product_table columns="name:Item Name, date:Added, cf:field1:Details, price:Cost Per Unit"]
Removing the column heading
If you would like to remove a column heading completely, use the keyword
blank after the colon. For example: