memberr Shopify Metafields
memberr uses Shopify shop metafields to store important configuration and settings. These metafields are accessible through the Shopify Admin API and Storefront API.
Accessing Shop Metafields
To access shop metafields in your liquid templates, use the following code:
_10{%- assign memberr = shop.metafields.app--60169453569--memberr_v2 -%}_10{% if memberr %}_10<p>{{ memberr.FIELD_NAME }}</p>_10{% endif %}
Available Metafields
Key | Type | Access | Description |
---|---|---|---|
organization_id | Text | Public Read | Unique identifier for the organization in the memberr system. |
organization_currency | Text | Public Read | Currency code used by the organization. |
exchange_rate | Money | Public Read | Exchange rate for currency conversion. |
public_key | Text | Public Read | Public API key for memberr integration. |
secret_key | Text | Private | Secret API key for memberr integration (not accessible in storefront). |
Access Levels
The metafields have different access levels depending on the context:
- Public Read: Accessible in both Admin and Storefront APIs
- Private: Only accessible through the Admin API
- None: Not accessible
Best Practices
Always check if metafields exist before accessing:
_10{% if shop.metafields.app--60169453569--memberr_v2.organization_id %}_10 <!-- Use organization ID -->_10{% endif %}
Parse dates appropriately:
_10{{ membership.created_at | date: "%Y-%m-%d" }}
Handle money values appropriately:
_10{% if shop.metafields.app--60169453569--memberr_v2.exchange_rate %}_10 {{ shop.metafields.app--60169453569--memberr_v2.exchange_rate.value | money }}_10{% endif %}