Home

Cashback Program Metaobject

The Cashback Program metaobject allows you to configure and manage cashback rewards for your customers. This documentation covers how to access and use the metaobject in your Shopify store.

Accessing the Metaobject

To access the Cashback Program metaobject in your Liquid templates, use the following code:


_10
{%- assign cashback_program = shop.metaobjects.app--60169453569--cashback_program.v2 -%}

Available Fields

The Cashback Program metaobject contains the following fields:

Field NameTypeDescription
is_activeBooleanControls whether the cashback program is currently active
cashback_percentageDecimalThe percentage of purchase amount awarded as cashback
credit_expiry_daysIntegerNumber of days until the cashback credit expires
credit_availability_delay_daysIntegerNumber of days before cashback credit becomes available

Field Details

Field NameTypePurposeUsage
is_activeBooleanControls the overall activation state of the cashback programUse this to conditionally enable or disable the entire cashback functionality
cashback_percentageDecimalDefines the percentage of the purchase amount that will be awarded as cashback(*)
credit_expiry_daysIntegerSpecifies how long the cashback credit remains valid after being issuedUse this to communicate to customers when their cashback store credit will expire
credit_availability_delay_daysIntegerDetermines how many days after a purchase the cashback credit becomes availableHelps manage the delay between purchase and cashback credit availability

(*) Display as a percentage value ( e.g., {{ cashback_program.cashback_percentage }}% )

Example Usage

Here's a complete example of how to display the Cashback Program settings in your Liquid template:


_27
{%- comment -%} Cashback Program {%- endcomment -%}
_27
{%- assign cashback_program = shop.metaobjects.app--60169453569--cashback_program.v2 -%}
_27
{% if cashback_program %}
_27
<h2>Cashback 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>{{ cashback_program.is_active }}</td>
_27
</tr>
_27
<tr>
_27
<td>Cashback Percentage</td>
_27
<td>{{ cashback_program.cashback_percentage }}%</td>
_27
</tr>
_27
<tr>
_27
<td>Credit Expiry Days</td>
_27
<td>{{ cashback_program.credit_expiry_days }}</td>
_27
</tr>
_27
<tr>
_27
<td>Credit Availability Delay Days</td>
_27
<td>{{ cashback_program.credit_availability_delay_days }}</td>
_27
</tr>
_27
</table>
_27
{% endif %}

Best Practices

  1. Always check if the metaobject exists before accessing its properties:

_10
{% if cashback_program %}
_10
// Your code here
_10
{% endif %}

  1. Format the cashback percentage appropriately:

_10
{{ cashback_program.cashback_percentage }}%

  1. Consider using the credit_availability_delay_days and credit_expiry_days values to create clear messaging about when cashback becomes available and expires.

  2. When displaying cashback amounts for specific purchases, calculate using the percentage:


_10
{% assign cashback_amount = order.total_price | times: cashback_program.cashback_percentage | divided_by: 100 %}
_10
{{ cashback_amount | money }}