Shortcode for show Attributes Image
If you use custom product templates to show attribute images in product short description for example, you can use our new shortcode. The shortcode is [woocommerce_attribute_images_attributes] with parameters for product (optional) and attributes (attribute name, separated by comma).
Example to show attributes color and size for current product:
[woocommerce_attribute_images_attributes attributes="color"]
Example to show attribute color for product with the ID 354:
[woocommerce_attribute_images_attributes product="PRODUCT_ID" attributes="color"]
Example showing only specific attribute values on non product pages:
[woocommerce_attribute_images_attributes attributes="pa_color" values="black,grey" ignore_product="yes" hide_empty="yes"]
Questions & answers (8)
BIBOUMay 21, 2022
I’m using a private theme but the attribute images is not showing in the product sidebar but it’s showing in the more ”information box” and i want to show the attribute image in the product sidebar
DanielMay 22, 2022
Please submit a ticket on our website so we can check your issue.
MichaelOctober 3, 2021
Hi, could it be that the URL is not working on the shortcode images? I get a href #. I use it on the product page.
DanielOctober 3, 2021
Please submit a ticket on our website. We have a patch for that already.
Mattias GunnarssonAugust 9, 2021
Is it possible to show the description for the attribute image? For example as a tooltip?
DanielAugust 9, 2021
A tooltip option is built in our plugin settings.
JerzyJuly 15, 2021
Hi there! Will those shortcodes will work with Beaver Builder? Also I don’t need to use it as a variations, just want to display image attributes on archives and product pages. Is it possible if attrivute is not used for creating variations?
DanielJuly 15, 2021
Yes of course. The shortcodes are designed to show attribute images regardless of the WooCommerce product type.