Lightspeed Installation Guide

Lightspeed Installation Guide

Inserting the helloretail tracking script and conversion tracking

Log in to your lightspeed backoffice and navigate to SettingsWeb extras

Insert the tracking script in the "CUSTOM JS" section:

The script should be

<script type="text/javascript">
 (function() {
 var aws = document.createElement('script');
 aws.type = 'text/javascript';
 if (typeof(aws.async) != "undefined") { aws.async = true; }
 aws.src = 'https://d1pna5l3xsntoj.cloudfront.net/scripts/company/awAddGift.js#YOUR_PARTNER_ID';
 var s = document.getElementsByTagName('script')[0];
 s.parentNode.insertBefore(aws, s);
 })();
</script>

Important: Once you have pasted it you should replace YOUR_PARTNER_ID with your own helloretail id. You can find this by logging into your account. You should also enable the custom javascript using the status toggle.

Insert the conversion tracking in th "TRACKING" section

The conversion tracking script should be

<script>
_awev=(window._awev||[]);_awev.push(["bind_once", "crawl_completed", function() {
 var product_numbers = [];
 {% for product in order.products %}
 product_numbers.push('{{ product.sku }}');
 {% endfor %}
 ADDWISH_PARTNER_NS.api.conversion.track_sale({
 total: {{ order.information.price_incl }},
 orderNumber: '{{ order.information.number }}',
 email: '{{ order.customer.email }}',
 productNumbers: product_numbers
 });
}]);
</script>

Remember to Save your changes

 

Create product and category feed

In this section we will guide you how to connect your product and category data to helloretail. The data is essential for all features that addwish can offer you.
In general helloretail retrieve product and category data from several platforms in what we call "feeds". The next steps will show you how to set up a product and category feed from where helloretail can retrieve and index your data.

Start by navigating to "Settings" -> "Feeds"

Click "Go to Custom Feeds" and click "Add feed" at the top of the page.

The first feed you will add is the product feed. Give your feed a name and click "Save"

Copy the feed code below into the editor and click save.

<?xml version="1.0" encoding="utf-8"?>
<products version="1.0">
 {% set category_lookup = {} %}
 {% for category in categories %}
 {% set ct = category.title|cdata %}
 {% set category_lookup = category_lookup|merge({("k" ~ category.id): "<category>#{ct}</category>"}) %}
 {% for subcategory in category.subs %}
 {% set sct = subcategory.title|cdata %}
 {% set category_lookup = category_lookup|merge({("k" ~ subcategory.id): "<category>#{ct}</category><category>#{sct}</category>"}) %}
 {% for subsubcategory in subcategory.subs %}
 {% set ssct = subsubcategory.title|cdata %}
 {% set category_lookup = category_lookup|merge({("k" ~ subsubcategory.id): "<category>#{ct}</category><category>#{sct}</category><category>#{ssct}</category>"}) %}
 {% endfor %}
 {% endfor %}
 {% endfor %}
 {% for product in products %}
 <product>
 <url>{{ product.url | url }}</url>
 <title>{{ product.fulltitle | cdata }}</title>
 <imgurl>{{ product.image | url_image | replace('image', 'image1') }}</imgurl>
 <currency>{{ shop.currency | upper }}</currency>
 {% if product.price.price_old_incl %}
 <oldprice>{{ product.price.price_old_incl | money_float }}</oldprice>
 {% endif %}
 <price>{{ product.price.price_incl | money_float }}</price>
 <productnumber>{{ product.sku | cdata }}</productnumber>
 <description>{{ product.description | cdata }}</description>
 <instock>{{ product.available ? "true" : "false" }}</instock>
 {% if product.brand %}
 <brand>{{ product.brand.title | cdata }}</brand>
 {% endif %}
 <ean>{{ product.ean | cdata }}</ean>
 <productcode>{{ product.code | cdata }}</productcode>
 <productid>{{ product.id | cdata }}</productid>
 <productvid>{{ product.vid | cdata }}</productvid>
 <hierarchies>
 {% if product.category %}<hierarchy>{{ category_lookup[("k" ~ product.category.id)] }}</hierarchy>{% endif %}
 {% if product.subcategory %}<hierarchy>{{ category_lookup[("k" ~ product.subcategory.id)] }}</hierarchy>{% endif %}
 {% if product.subsubcategory %}<hierarchy>{{ category_lookup[("k" ~ product.subsubcategory.id)] }}</hierarchy>{% endif %}
 {% for category1 in product.categories %}
 <hierarchy>
    <category>{{ category1.title|cdata }}</category>
        {% for category2 in category1.subs %}
             <category>{{ category2.title|cdata }}</category>
            {% for category3 in category2.subs %}
                 <category>{{ category3.title|cdata }}</category>
        {% for category4 in category3.subs %}
          <category>{{ category4.title|cdata }}</category>
          {% for category5 in category4.subs %}
            <category>{{ category5.title|cdata }}</category>
          {% for category6 in category5.subs %}
            <category>{{ category6.title|cdata }}</category>
          {% endfor %}
          {% endfor %}
        {% endfor %}
             {% endfor %}
         {% endfor %}
   </hierarchy>
{% endfor %}
</hierarchies>
 </product>
 {% endfor %}
</products>

Go back to your list of feeds by clicking "Close".

Now you will add the category feed. Start by clicking "Add feed".

Give your feed a name and click "Save"

Copy the feed code below into the editor and click save.

<?xml version="1.0" encoding="utf-8"?>
<categories>
    {% for category1 in categories %}
    <category>
        <id>{{ category1.id | cdata }}</id>
        <url>{{ category1.url | url }}</url>
        <title>{{ category1.title | cdata }}</title>
        <description>{{ category1.description | cdata }}</description>
        <imgUrl>{{ category1.image | url_image }}</imgUrl>
        <hierarchy>
            <category>{{ category1.title | cdata }}</category>
        </hierarchy>
    </category>
    {% for category2 in category1.subs %}
    <category>
        <id>{{ category2.id | cdata }}</id>
        <url>{{ category2.url | url }}</url>
        <title>{{ category2.title | cdata }}</title>
        <description>{{ category2.description | cdata }}</description>
        <imgUrl>{{ category2.image | url_image }}</imgUrl>
        <hierarchy>
            <category>{{ category1.title | cdata }}</category>
            <category>{{ category2.title | cdata }}</category>
        </hierarchy>
    </category>
    {% for category3 in category2.subs %}
    <category>
        <id>{{ category3.id | cdata }}</id>
        <url>{{ category3.url | url }}</url>
        <title>{{ category3.title | cdata }}</title>
        <description>{{ category3.description | cdata }}</description>
        <imgUrl>{{ category3.image | url_image }}</imgUrl>
        <hierarchy>
            <category>{{ category1.title | cdata }}</category>
            <category>{{ category2.title | cdata }}</category>
            <category>{{ category3.title | cdata }}</category>
        </hierarchy>
    </category>
    {% for category4 in category3.subs %}
    <category>
        <id>{{ category4.id | cdata }}</id>
        <url>{{ category4.url | url }}</url>
        <title>{{ category4.title | cdata }}</title>
        <description>{{ category4.description | cdata }}</description>
        <imgUrl>{{ category4.image | url_image }}</imgUrl>
        <hierarchy>
            <category>{{ category1.title | cdata }}</category>
            <category>{{ category2.title | cdata }}</category>
            <category>{{ category3.title | cdata }}</category>
            <category>{{ category4.title | cdata }}</category>
        </hierarchy>
    </category>
    {% for category5 in category4.subs %}
    <category>
        <id>{{ category5.id | cdata }}</id>
        <url>{{ category5.url | url }}</url>
        <title>{{ category5.title | cdata }}</title>
        <description>{{ category5.description | cdata }}</description>
        <imgUrl>{{ category5.image | url_image }}</imgUrl>
        <hierarchy>
            <category>{{ category1.title | cdata }}</category>
            <category>{{ category2.title | cdata }}</category>
            <category>{{ category3.title | cdata }}</category>
            <category>{{ category4.title | cdata }}</category>
            <category>{{ category5.title | cdata }}</category>
        </hierarchy>
    </category>
    {% for category6 in category5.subs %}
    <category>
        <id>{{ category6.id | cdata }}</id>
        <url>{{ category6.url | url }}</url>
        <title>{{ category6.title | cdata }}</title>
        <description>{{ category6.description | cdata }}</description>
        <imgUrl>{{ category6.image | url_image }}</imgUrl>
        <hierarchy>
            <category>{{ category1.title | cdata }}</category>
            <category>{{ category2.title | cdata }}</category>
            <category>{{ category3.title | cdata }}</category>
            <category>{{ category4.title | cdata }}</category>
            <category>{{ category5.title | cdata }}</category>
            <category>{{ category6.title | cdata }}</category>
        </hierarchy>
    </category>
    {% endfor %}
    {% endfor %}
    {% endfor %}
    {% endfor %}
    {% endfor %}
    {% endfor %}
</categories>

Go back to your list of feeds by clicking "Close".

Send the url of the two feeds you have created to helloretail on support@helloretail.com

  • 2 mths agoLast active
  • 51Views
  • 1 Following