Skip to main content

How to show prices your way on your WordPress website

Use the data_pricing options on the store and product-details shortcodes to choose which price shows, add text before or after it and set decimal places. Add a "carrot" message under prices, such as "10% off for club members".

Choose which price shows

Add data_pricing_display to the store, store-products or product-details shortcode:

  • price or bottlePrice: the cheapest price per bottle, not including club discounts.

  • bottlePriceHigh: the most expensive price per bottle.

  • fullPrice: the full price.

  • singlePrice: the single bottle price.

  • halfDozenPrice and dozenPrice: the price for 6 or 12.

  • inAny6Price and inAny12Price: the per-bottle price when bought in 6 or 12.

  • userPrice: the price for the logged-in customer, for the minimum quantity they can buy.

  • productPrice: the price for the minimum quantity, calculated for the logged-in customer if they're logged in.

  • minimumUnitPrice: the price for the minimum quantity, not calculated for the logged-in customer.

Separate prices with | to show the next price when the first isn't set, for example singlePrice|inAny6Price|inAny12Price.

Add text and set decimals

  • data_pricing_prefix='From ' adds text before the price. The prefix shows on the product page and on version 1 shop pages, but not on version 2 shop pages.

  • data_pricing_suffix=' per bottle' adds text after the price. On shop pages, the suffix replaces the bottle size, for example "/ 750ml" becomes "/ per bottle".

  • data_pricing_decimals='0' shows whole dollars.

Example:

[withwine type='product-details' data_pricing_display='singlePrice|inAny6Price' data_pricing_suffix=' per bottle' data_pricing_decimals='0' /]

Add a message under the price

A "carrot" is a short message under the price on the product page, with an optional link:

[withwine type='product-details' data_carrot_text='10% off for Ridge Club members' data_carrot_action='Join now' data_carrot_url='/join-the-ridge-club' /]

Add data_carrot_target='_blank' to open the link in a new tab.

Show a price on its own

[withwine type='product-price' data_product_id='PRODUCT ID' /]

  • data_showif='loggedin' or 'loggedout' shows the price only to logged-in or logged-out visitors.

  • data_formatted='true' shows the price as currency.

  • data_formatoptions_currency='AUD' and data_formatoptions_local='en-AU' set the currency and format.

Related articles

Did this answer your question?