Shortcodes included with Price Based on Country

Price Based on Country comes with several shortcodes. You can uses the shortcodes to insert content inside posts and pages.

Parameters (or Args)

Some shortcodes accept parameters. The parameters are ways to make the shortcode more specific. For example, by adding id="99" to the [wcpbc_product_price] shortcode, it will display the price of the product with ID 99.

Country Switcher

Shows the country switcher widget. The shortcode supports the following parameters:

  • other_countries_text – The text of the “other countries” option. Defaults to “Other countries.”
  • title – The title of country switcher. Defaults to empty (no title).
  • remove_other_countries – Set to 1 to remove the “other countries” option. Defaults to 0 (do not remove). Only available in the Pro version.

[wcpbc_country_selector remove_other_countries="1"]

Currency Switcher

Pro version featureUpgrade to Pro now!

Shows the currency switcher widget.

Parameters:

  • title – The title of currency switcher. Defaults to empty (no title).
  • currency_display_style – How the currency switcher widget will display each option. Uses {code} for the currency code, {symbol} for the currency symbol, and {name} for the currency name. Defaults to {name} ({symbol}).

Examples:

  • {name} ({symbol}) – The option for the EUR currency will display “Euro (€)“.
  • {code} - {symbol} – Will display “EUR – €”.
  • {code} – Displays the option like “EUR”.

[wcpbc_currency_switcher currency_display_style="{code}"]

Product Price

Pro version featureUpgrade to Pro now!

Displays the price of a specific product. It supports the “Load product price in the background” option.

Parameters:

  • id – The ID of the product. Mandatory.
  • zone – The slug (or ID) of the pricing zone you want to display the price. Defaults to empty. If you don’t add the zone parameter, the shortcode will show the price for the current pricing zone.

[wcpbc_product_price id="99"]

Content

Pro version featureUpgrade to Pro now!

The wcpbc_content shortcode allows you to display content for a specific pricing zone (a group of countries). It supports the AJAX geolocation feature (or “Load product price in the background” option), so it also works with cache plugins.

Parameters:

  • zone – The slug (or ID) of the pricing zone you want to display the content. Mandatory.
  • wrapper_tag – The HTML tag that the shortcode will use to wrap the content. Defaults to span.

[wcpbc_content zone="canada"]Free shipping to Canada.[/wcpbc_content]

The wcpbc_content_default shortcode displays content for “Countries not covered by your other zones.”

Parameters:

  • wrapper_tag – The HTML tag that the shortcode will use to wrap the content. Defaults to span.

[wcpbc_content_default]Free Shipping on orders over $50[/wcpbc_content_default]

Convert amount

Pro version featureUpgrade to Pro now!

Displays an amount converted to the currency of the current pricing zone.

Parameters:

  • amount – The amount in the base currency that you want to display.

[wcpbc_convert amount="100"]