Show Points Customers Earn on WooCommerce Product Pages

The [WPGENS_PRODUCT_EARNING] shortcode renders the points earning notice for a specific product. Use it on custom product pages built with Elementor, Breakdance, Divi, or any other page builder, or to embed a product earning notice anywhere on your site.

[WPGENS_PRODUCT_EARNING]

[WPGENS_PRODUCT_EARNING id="123"]

Parameters

ParameterRequiredDefaultDescription
idNoCurrent product in the loopThe WooCommerce product ID. When omitted the shortcode uses the global $product object, which works correctly inside a product loop or on a single product page.

What It Displays

The shortcode outputs the same points earning message as the built-in product page hook. For variable products it respects the variable product logic and updates the displayed points when the customer selects a variation. The message text and format follow the template configured under Points and Rewards → Settings → Earning.

The shortcode outputs nothing if the product is not found, the user is logged in under a role excluded from earning points, or the Points Earning feature is disabled.

Usage Examples

On a custom product page (no id needed)

When your page builder is rendering a single product page, the global $product object is already set. Simply drop the shortcode wherever you want the notice to appear in your layout.

[WPGENS_PRODUCT_EARNING]

Embed a specific product notice anywhere

Use the id parameter to display the earning notice for a specific product on any page, such as a homepage featured product section or a landing page.

[WPGENS_PRODUCT_EARNING id="123"]
Browse our plugins

Lightweight WooCommerce plugins built for speed. No bloat, no frameworks -- just clean code that works.

View all plugins
Stay in the loop

Get notified when we launch new plugins. No spam, just product updates.