View Categories

MSRP Shortcodes

MSRP (RRP) Pricing for WooCommerce registers one shortcode, [alg_wc_msrp_wpml]. It shows or hides its inner content based on the active site language, which is useful inside the plugin’s template fields when you run WPML or Polylang.

Note: MSRP Pricing does not use shortcodes to output the MSRP itself. The MSRP is rendered automatically next to the product price, controlled by the display settings under WPFactory > MSRP (also reachable at WooCommerce > Settings > MSRP). Earlier versions of this article listed product, savings and country/currency shortcodes that the plugin does not provide; those have been removed.

The language shortcode #

[alg_wc_msrp_wpml] wraps content you want shown only for, or only outside of, a set of languages. Place it inside the Final Template, Template if no MSRP is defined, or Cart total savings Template fields (template editing requires Pro).

Attribute Meaning Default
lang Show the content only when the active language is in this comma-separated list of codes. empty
not_lang Hide the content when the active language is in this comma-separated list of codes. empty

Examples #

[alg_wc_msrp_wpml lang="en"]MSRP[/alg_wc_msrp_wpml]
[alg_wc_msrp_wpml lang="de"]UVP[/alg_wc_msrp_wpml]
[alg_wc_msrp_wpml not_lang="fr"]MSRP[/alg_wc_msrp_wpml]

The first two lines let you show a different MSRP label per language inside the same template. The third shows its content in every language except French. When WPML or Polylang is not active, content wrapped with a lang attribute is hidden.

Reading MSRP in code #

If you need the MSRP value in a theme template or snippet rather than a shortcode, use the helper function alg_wc_msrp_get_product_msrp(). It returns the MSRP, the savings amount, or the savings percentage for a product. See the MSRP developer hooks, filters and functions reference for its parameters.

Get more control #

Editing the template fields where this shortcode is used is a Pro feature. MSRP (RRP) Pricing for WooCommerce Pro unlocks full template editing along with MSRP by country, by currency and by user role. See what Pro unlocks.