rpress_price()

Author: bibhu 336 views

This function will output a nicely formatted price of any specified fooditem. It accepts three parameters:

  • A fooditem id, for the fooditem whose price should be displayed
  • An echo boolean.  Defaults to true.
  • A price id for variable pricing. Defaults to the first variation

Example:

rpress_price( 12 ); // will output something like $10 for product 12

$rpress_price = rpress_price( 12, false ); // stores the amount for fooditem id 12 in $rpress_price

rpress_price( 12, true, 1 ); // echos the price of the first variation on fooditem id 12

The price amount is formatted with the currency set in the plugin options, as well as the currency sign position.