Birthday Reward Program Metaobject
The Birthday Reward Program metaobject allows you to configure and manage birthday rewards for your customers. This documentation covers how to access and use the metaobject in your Shopify store.
Accessing the Metaobject
To access the Birthday Reward Program metaobject in your Liquid templates, use the following code:
_10{%- assign birthday_program = shop.metaobjects.app--60169453569--birthday_reward_program.v2 -%}
Available Fields
The Birthday Reward Program metaobject contains the following fields:
Field Name | Type | Description |
---|---|---|
is_active | Boolean | Controls whether the birthday reward program is currently active |
amount | Money | The monetary value of the birthday reward |
credit_expiry_days | Integer | Number of days until the birthday credit expires |
credit_advance_days | Integer | Number of days before the birthday when the credit becomes available |
Example Usage
Here's a complete example of how to display the Birthday Reward Program settings in your Liquid template:
_27{%- comment -%} Birthday Reward Program {%- endcomment -%}_27{%- assign birthday_program = shop.metaobjects.app--60169453569--birthday_reward_program.v2 -%}_27{% if birthday_program %}_27<h2>Birthday Reward Program</h2>_27<table class="program-table">_27 <tr>_27 <th>Setting</th>_27 <th>Value</th>_27 </tr>_27 <tr>_27 <td>Is Active</td>_27 <td>{{ birthday_program.is_active }}</td>_27 </tr>_27 <tr>_27 <td>Amount</td>_27 <td>{{ birthday_program.amount.value | money }}</td>_27 </tr>_27 <tr>_27 <td>Credit Expiry Days</td>_27 <td>{{ birthday_program.credit_expiry_days }}</td>_27 </tr>_27 <tr>_27 <td>Credit Advance Days</td>_27 <td>{{ birthday_program.credit_advance_days }}</td>_27 </tr>_27</table>_27{% endif %}
Field Details
Field Name | Type | Purpose | Usage |
---|---|---|---|
is_active | Boolean | Controls the overall activation state of the birthday reward program | Use this to conditionally enable or disable the entire birthday reward functionality |
amount | Money | Defines the reward amount given to customers on their birthday | (*) |
credit_expiry_days | Integer | Number of days until the birthday credit expires | Use this to communicate to customers when their birthday reward will expire |
credit_advance_days | Integer | Number of days before the birthday credit becomes available | Helps in setting up early birthday reward distribution for better customer experience |
(*) Always use the money
filter when displaying this value
( e.g.{{ birthday_program.amount.value | money }}
)
Best Practices
- Always check if the metaobject exists before accessing its properties:
_10{% if birthday_program %}_10 // Your code here_10{% endif %}
- Use proper money formatting for the amount field:
_10{{ birthday_program.amount.value | money }}
- Consider using the
credit_advance_days
andcredit_expiry_days
values to create clear messaging about when rewards become available and expire.