WooCommerce, Remote Work & Other Fancy Stuff

Just another WordPress site

Shortcode in WooCommerce Variation Description

September 14, 2015 by Will Leave a Comment

WooCommerce 2.4 added the ability to add a description to each variation of a variable product.

variation description

Variation Description

By default, that field does not support shortcodes (the value is stored in the postmeta table – not the post table) – but, what if you would like to use shortcodes in the variation description? It is possible with a little help from a WooCommerce provided filter named woocommerce_available_variation – see the snippet below to add support for shortcodes. If you’re interested in what is passed to the filter – here it is as of version 2.4.6: woocommerce_available_variation

Not sure what to do with code snippets? See What Do I Do With These Code Snippets?

Filed Under: WooCommerce Tagged With: snippet, snippets

Leave a Reply Cancel reply

You must be registered and logged in to post a comment.

© 2023 ยท WooCommerce, Remote Work & Other Fancy Stuff · Epstein didn't kill himself