After creating, or selling with WooCommerce, some booking passes, your customers should be able to find them to check their balance, expiration date, copy their redemption code, etc. You can display their booking passes list very simply using a shortcode:
- Go to the post / page where you want to display user’s bookings list in admin panel
- Tip: My account page of any subpage is a good choice
- Copy and paste this simple shortcode:
[bookingactivities_passes]wherever you want on this page - Go to this page on the frontend and the connected user’s booking passes list appears
The user must be logged in and have at least one booking, else nothing would appear.
So it is recommended to display a login form on the same page, see this docs.
The [bookingactivities_passes] shortcode has a lot of attributes allowing you to filter the displayed booking passes:
| Attribute | Expected value |
|---|---|
id |
The desired booking pass IDs (integers) (comma separated). |
user_id |
The desired user ID (integer), current, or all.Default: current. |
in__pass_template |
IDs of the booking pass templates (integers) (comma separated). |
active |
Filter inactive booking passes (allowed values: 0, 1, ou both).Default: 1 (active passes only). |
expired |
Filter expired (allowed values: 0, 1, ou both).Default: both. |
expiration_date |
Expiration date to be taken into account (YYYY-MM-DD format, or a compatible relative format such as +7 day or last day of this month). The expired attribute must be 0. |
events_from / events_to |
Min and max event start date (YYYY-MM-DD format, or a compatible relative format such as +7 day or last day of this month). |
created_from / created_to |
Min and max booking pass creation date (YYYY-MM-DD format, or a compatible relative format such as +7 day or last day of this month). |
order_by |
Order the list by data (allowed values: id, pass_template_id, credits_current, credits_total, user_id, creation_date, expiration_date, events_from, events_to, active, redeem_code) (ordered and comma separated).Default: id. |
order |
Sorting order of the list (allowed values: asc or desc).Default: desc. |
columns |
Displayed columns (allowed values: id, pass_template_id, credits_current, credits_total, user_id, creation_date, expiration_date, events_from, events_to, active, redeem_code, actions) (ordered and comma separated).Default: id,title,redeem_code,credits,expiration_date,actions.. |
Here is an example how to use the attributes:
[bookingactivities_passes active="both" columns="title,redeem_code,credits,actions" order_by="active,id"]
Now, all that’s left is for your customers to make use of their booking passes!
