Price data contract

Prices are post meta, stored as text, one key per serving format.

The keys

Meta key Format Menu types
precio-racion-completa Full portion a_la_carte_menu, terrace_menu, breakfast, desserts, bar_menu
precio-media-racion Half portion a_la_carte_menu, terrace_menu, breakfast, desserts, bar_menu
precio-unidad Unit a_la_carte_menu, terrace_menu, breakfast, desserts, bar_menu
precio-copa Glass wine_list, cocktails, beverages
precio-chupito Shot beverages
precio-botella Bottle wine_list, beverages
precio-botella-magnum Magnum wine_list
precio-botella-benjamin Benjamin wine_list
precio-menu Menu price tasting_menu, set_menu
precio-maridaje Pairing price tasting_menu

On cocktails, precio-copa is the single price and is labelled Price in the bulk tools.

Values are strings

Prices are stored exactly as entered, sanitized as text. They may contain a currency symbol, a decimal comma or point, and free-form qualifiers such as 10,80€ (6 unidades).

Do not assume a parseable number. Code that computes on prices must define its own parsing and handle values it cannot parse.

Empty versus zero

Stored value Meaning
Empty / missing The format is not offered; nothing is displayed
0 A real price of zero; displayed as one

Treat an empty meta value as absence, not as zero.

Reading prices

$full = get_post_meta( $post_id, 'precio-racion-completa', true );

if ( '' !== trim( (string) $full ) ) {
    // The item is offered in a full portion.
}

Writing prices

Prices are ordinary post meta and can be written with update_post_meta(). Two behaviors of the product's own tools are worth matching:

  • Bulk import skips empty cells, so an import never blanks a stored price.
  • Inline list editing writes a single key for a single post.

Prices across translations

Price fields are configured to stay in step across a menu item's translations. Read a price from any translation and expect the same value; write to the source item rather than to a translated record.

Prices and market references

The wine list additionally stores non-public reference values:

Meta key Meaning
supermarket_price Recommended retail price
min_restaurant_price Minimum recommended restaurant price
avg_restaurant_price Average restaurant price
max_restaurant_price Maximum recommended restaurant price

These are internal guidance and are not rendered to guests. Do not surface them on a public template.

Price presentation

Public output pairs each price with an icon identifying its format. The PDF generator adds two per-menu-type settings — a prefix and a suffix applied to every price — which live in the generator's own settings rather than in the meta value.

Two filters allow the PDF price icons to be overridden:

Filter Purpose
pom_rm_pdf_menu_price_icon_url Supply a URL for a price icon
pom_rm_pdf_menu_price_icon_markup Supply markup for a price icon

Integration guidance

  • Read the keys for the menu type you are handling; do not assume all ten exist.
  • Present empty formats as absent, never as 0.
  • Preserve the stored string when displaying; reformatting silently changes the menu.
  • If you must compute, parse defensively and fail visibly rather than guessing.