View Categories

How to Display Dynamic Product Data in a Tab

Show live product data in a global tab #

A global tab in Additional Custom Product Tabs for WooCommerce shows the same content on every product, but shortcodes let that one tab display data that is different for each product, such as the SKU, price, or a custom field. This is a free feature and a fast way to add the same block of dynamic information store-wide.

Before you start #

  • The Custom Tabs: All Products section enabled, with a tab that has a Title and Content.
  • The shortcodes are covered in full in the product tabs shortcodes reference.

Example: add a stock info line to every product #

  1. Go to WPFactory > Product Tabs > Custom Tabs: All Products.
  2. Set the tab Title to something like Product info.
  3. In Content, add:
    Stock: [alg_wc_pt_product_function name="get_stock_quantity" on_empty="In stock"]
    SKU: [alg_wc_pt_product_function name="get_sku"]
  4. Save. Each product now shows its own stock number and SKU in that tab.

Example: show a custom field #

If your products store a value in a custom field, print it with the product meta shortcode:

[alg_wc_pt_product_meta key="_my_custom_field" before="Material: " on_empty="Not specified"]

The before text only appears when the field has a value, and on_empty gives a fallback when it does not.

Useful product functions #

name value Outputs
get_name Product name
get_price_html Formatted price
get_sku SKU
get_description Long description

Troubleshooting #

  • Nothing shows for a product: that product has no value for the method or field. Add an on_empty attribute for a fallback.
  • The tab itself is missing: a tab needs both a Title and Content to render.

Get more control #

Dynamic content through shortcodes is free. When you want more than one global tab to hold it, Additional Custom Product Tabs for WooCommerce Pro removes the limit. See what Pro unlocks.