会員ランクのメタデータ
LiquidファイルでまずEasyPointsの顧客メタフィールドを`customer_ep_metafield`をアサインして、
その後`customer_ep_metafield.tier`で顧客のランクデータを取得します。
{%- assign customer_ep_metafield = customer.metafields.loyalty.easy_points_attributes.value -%}
Goldランク会員のみ対象の商品がある場合、以下のコードのようにストア上に表示する情報を
調整いただけます。
{%- if customer_ep_metafield.tier == "Gold" -%}
ゴールド会員限定の商品を購入する
{% else %}
この商品はゴールド会員限定の商品です
{% endif %}
顧客のポイント還元率(%)
以下コードでまずEasyPoints上のポイント還元率(%)をアサインします。
{%- liquid
assign shop_ep_metafield = shop.metafields.loyalty.easy_points_attributes.value
assign ep_percentage = shop_ep_metafield.percentage
if customer
assign customer_ep_metafield = customer.metafields.loyalty.easy_points_attributes.value
assign ep_percentage = customer_ep_metafield.percentage
endif
-%}
その後、`{{ ep_percentage | round }}`のコードでLiquidファイル内に顧客のランクに応じた
ポイントの還元率(%)を表示させます。
なお、ボーナスポイントによるポイントの還元率は含まれません。