Woo - Dynamic Shortcodes

Explore the Woo Dynamic Shortcode, offering advanced functionality for retrieving and customizing WooCommerce data.

Updated over a week ago

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 display

  • keyargs: A list of key arguments.

Key Arguments

  • id: Specifies the WooCommerce product ID.

Examples

  1. Basic Product Price Display: {woo:price} Displays the price of current product.

  2. Product Attributes and Description: {woo:attributes@id=20} Retrieves and displays the attributes of the product with ID 20.

  3. 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.

Did this answer your question?