Shopify App

Product metafields

Customize your storefront product pages with event fields.

Jeff Blake
Written by Jeff Blake Updated over a week ago

Metafields can be very useful to have on hand when designing or customizing your theme. For example, you may want to display the event date, time, location, etc in a structured way, rather than putting it into the product title or description.

Namespace

For any supported type (currently only Products), all metafields are stored in the event_ticketing namespace. To output all metafields for an product, you can do:

{{ product.metafields.event_ticketing }}

As Guest Manager uses liquid too, the liquid variables and format is the same for consistency. E.g., in Guest Manager the venue name might be accessible as {{ event.venue.name }}and in Shopify it would be accessible (in a product) as {{ product.metafields.event_ticketing.event.venue.name }}

Dates

The start and end date are stored as meta fields. Note: for multi-day events, the start date will be the first event, and the end date is the last event in the series.

{{ product.metafields.event_ticketing.event.starts_at }} -> 2020-07-16T08:00:00.000000-07:00 (Time zone aware ISO8601 date format)

{{ product.metafields.event_ticketing.event.ends_at }}

To format the date, you may use liquid filters, for example:

{{ product.metafields.event_ticketing.event.starts_at | date: "%a, %b %d, %Y" }}-> Thu, Jul 16, 2020

For help formatting dates, please refer to the following guides:

Product metafields

Key Description Example Tag
starts_at Event start date and time (with time zone). 2020-07-16T08:00:00.000000-07:00 {{ product.metafields.event.starts_at }}
ends_at Event end date and time (with time zone). 2020-07-16T08:00:00.000000-07:00 {{ product.metafields.event.ends_at }}
       

Examples

Did you find the article useful? Have a suggestion or feedback?

Leave feedback in our Help Center