The WooCommerce Dynamic Shortcode is a versatile tool designed for WordPress, enabling users to dynamically display WooCommerce product information.
Syntax
{woo:args@keyargs}
args
: the argument to specify the WooCommerce product information you want to displaykeyargs
: A list of key arguments.
Key Arguments
id
: Specifies the WooCommerce product ID.
Examples
Basic Product Price Display:
{woo:price}
Displays the price of current product.Product Attributes and Description:
{woo:attributes@id=20}
Retrieves and displays the attributes of the product with ID 20.Sale Price with Fallback:
{woo:sale-price@id=25?No sale price}
Shows the sale price of product ID 25; displays "No sale price" if none exists.
Special Privileges
The Woo Dynamic Shortcode requires special privileges in certain scenarios:
Access to Non-Public Products: To read meta data from non-public posts, the shortcode must be used within a Power Shortcode.