Product attribute

For displaying products that have a specific attribute with WooCommere the [products] or [product_attribute] shortcodes can be used. If your WooCommerce version is lower than 3.2 then you should use the latter.

The appearance of the displayed products depends on your active theme, the following examples are using Chap theme, but the shortcodes work with any theme as long as you’re using WooCommerce.

Displaying WooCommerce products by attribute using the products shortcode
$20.00
Select options
Sale!
$30.00$35.00
Select options
<products attribute="color" filter="black" />
WooCommerce product attribute shortcode
$20.00
Select options
Sale!
$30.00$35.00
Select options
<product_attribute attribute="color" filter="black" />
Notes
The old product_attribute shortcode should be used for WooCommerce version 3.1 or lower.

Leave a comment

Your email address will not be published. Required fields are marked *