Customising the Shopify UX with Spaaza Embed
When Spaaza’s Shopify App is installed, Spaaza Embed is automatically included in the Shopify template files using a default configuration.
It’s possible to customise how and where Spaaza Embed is shown in your Shopify webshop by adding the following to the liquid template files where you want to show Spaaza Embed
Add the following to the liquid template file (or files) in which you want Spaaza Embed to be shown:
{% assign chain_id = shop.metafields['spaaza'].chain_id %}
{% assign myprice_app_hostname = shop.metafields['spaaza'].myprice_app_hostname %}
{% assign store_hash = shop.metafields['spaaza'].store_hash_external %}
{% assign store_domain = shop.domain %}
{% if customer %}
{% assign customer_id = customer.id %}
{% assign user_hash = customer.metafields['spaaza'].user_hash %}
{% assign user_hash_external = customer_id | hmac_sha256: store_hash %}
{% endif %}
<div class="spaaza-shopify-data"
data-customer-myprice-domain="{{myprice_app_hostname | escape}}"
data-customer-chain-id="{{chain_id | escape}}"
{% if customer %}
data-customer-shopify-id="{{customer_id | escape}}"
data-customer-user-hash="{{user_hash | escape}}"
data-customer-user-hash-external="{{user_hash_external | escape}}"
<iframe
id="spaaza-embed"
allow="clipboard-write"
src="https://{{myprice_app_hostname}}/?session_user_hash={{ user_hash }}&session_user_hash_external={{ user_hash_external }}&session_authentication_point_identifier={{ customer_id }}&chain_id={{ chain_id }}"
width="320"
height="320"
frameborder="0">
</iframe>
{% endif %}>
</div>
You will also need to add the below script tag in your theme.liquid
file
<script src="https://apistage0.spaaza.com/shopify/assets/shopify.js" defer="defer"></script>
Contact a member of our team to confirm the URL you should be using in the above cases if you are unsure.