# Upgrading EP integration to version 2.2.0
Update the static integration files themselves
Update point balance targets
# Old
<span data-loyal-target="balance">-</span>
# New
Ensure this snippet is used somewhere customer
is defined.
<span data-loyal-target="balance">
{{ customer.metafields.loyalty.easy_points_attributes.value.balance }}
</span>
- Easypoints integration asset files are now included in the existing head EP content as opposed to previously coming after it. Please move the loading of these files. The final result should look something like this:
{%- comment -%} START EASYPOINTS - DO NOT MODIFY! 変更しないでください! INFO @ https://bit.ly/2Dn7ESM {%- endcomment -%}
{%- unless shop.metafields.loyalty.easy_points_attributes.value.stealth_mode -%}
{% render 'easy_points_metafield_script' %}
{{ 'easy_points.css' | asset_url | stylesheet_tag }}
{{ 'easy_points.js' | asset_url | script_tag }}
{{ 'easy_points_integration.css' | asset_url | stylesheet_tag }}
{{ 'easy_points_integration.js' | asset_url | script_tag }}
{%- endunless -%}
{%- comment -%} END EASYPOINTS {%- endcomment -%}
- Update the use of EP metafields to new JSON metafields.
Old metafield example:
{% if shop.metafields.loyalty['widget'] == "true" %}
New metafield example:
{% if shop.metafields.loyalty.easy_points_attributes.value.widget %}
Old metafield example:
{% if shop.metafields.loyalty['stealth_mode'] == "false" %}
New metafield example:
{% unless shop.metafields.loyalty.easy_points_attributes.value.stealth_mode %}
For readability it is also recommended to use assign
for the EP metafields, especially if you need to access it multiple times.
{% assign shop_ep_metafield = shop.metafields.loyalty.easy_points_attributes.value %}
{% unless shop_ep_metafield.stealth_mode %}
{% if shop_ep_metafield.widget %}
...
{% endif %}
{% endunless %}
- Ensure the shop's
app_version
field has been updated to be >=2.2.0 while also respecting any other changes needed by lower version updates.