Product recommendations in the shopping cart
    • PDF

    Product recommendations in the shopping cart

    • PDF

    Article summary

    Store connection via URL

    💡 How do I add the products to the online store shopping cart?

    1. Find out the URL for the connection

    Find out which URL your store system uses to enable a shopping cart connection.

    You should first ask the IT department responsible for the online store. Alternatively, the support or the documentation of the online store can help you.

    Depending on the store system, there is a different URL structure for this. In general, the link is structured as follows:

    • <domain>/<url-endpoint>?{{#each recommendations}}

    • p{{add @index 1}}={{this.ean}}&

    • q{{add @index 1}}={{this.quantity}}&

    • u{{add @index 1}}={{this.unit}}&

    • {{/each}}

    Each recommendation on the results page is supplemented in turn with an ID/item number (p), a quantity (q) and a unit (u) on the shopping cart link.

    Example: General

    Template:

    www.customer.de/shop?{{#each recommendations}}p{{add @index 1}}={{this.id}}&q{{add @index 1}}={{this.amount}}&{{/each}}


    Result:

    www.customer.de/shop?p1=AB12&q1=1&p2=AW94&q2=2&p3=DG01&q3=1&

    Example: Shopify

    Template:

    https://customershop.myshopify.com/cart/add?{{#each recommendations}}id[]={{this.id}}&quantity=1&{{/each}}


    Result:

    https://customershop.myshopify.com/cart/add?id[]=AB12&quantity=1&id[]=AW94&quantity=2&id[]=DG01&quantity=1&

    Example: Adding products to the shopping cart based on certain attributes

    Only products with the data attribute shop_id should include quantity be placed in the shopping cart:

    Template:

    customer.shop/addtocart?p={{#each recommendations}}{{#if this.shop_id}}{{#unless @first}}-{{/unless}}{{this.shop_id}}{{/if}}{{/each}}&qp={{#each recommendations}}{{#if this.shop_id}}{{#unless @first}}-{{/unless}}{{this.Menge}}{{/if}}{{/each}}


    Result:

    customer.shop/addtocart?p=AB12-AW94-DG01&qp=1-2-1

    Example: Adding products from Sort Groups to the shopping cart

    The products are divided into groups in the result (Sort Groups), the article number is in the attribute sku. The product quantity is defined in the attribute quantity attribute.


    Template:

    customer.shop/checkout.addtocart.html?{{#each sortGroups}}p{{add @index 1}}={{#each this.products}}{{this.sku}}{{/each}}&q{{add @index 1}}={{this.Menge}}&{{/each}} 


    Result:

    customer.shop/checkout.addtocart.html?p1=AB12&q1=1&p2=AW94&q2=2&p3=DG01&q3=1&


    Was this article helpful?