Link Search Menu Expand Document

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 %}
    {% 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 %}
        <iframe id="spaaza-embed" src="https://{{ chain_id }}.embed.spaaza.com/?session_user_hash={{ user_hash }}&session_user_hash_external={{ user_hash_external }}&session_authentication_point_identifier={{ customer.id }}&chain_id={{ chain_id }}"</iframe> 
    {% endif %}   

Note that if you are using a customised version of Spaaza Embed the iFrame URL structure may be different (often https://{{ chain_id }}.spaaza.com). Similarly if you are using our staging infrastructure the URL will be different (often https://{{ chain_id }}-test01.spaaza.com).

Contact a member of our team to confirm the URL you should be using in the above cases if you are unsure.