Step 3: Update your cart

Once you have tagged your prices, you should add a product that is in the test to cart while previewing the test. In certain cases, you may notice an issue in the cart when you do this - a few examples of things that may happen include:

  • There may be a few visible line item properties in the cart

  • The compare-at price will not display correctly in the cart - for example, the compare price may show as the control price, rather than the compare price for the test group you are in

Should any of these happen, follow the below corresponding guidance to correct the issue and complete the integration.

Remove Hidden Line Item Propertiesโ€‹

Most Shopify stores use a convention that states that any line item property with a leading underscore (_) should not be displayed in the cart. Intelligems uses the line item property '_igp', so as long as this convention is set up for your store, the Intelligems line item property will be automatically hidden.

If this convention is not already set up for your store, You may see something like this in the cart when you test it in preview mode:

Here is an example of how you can fix this by implementing the below in a liquid cart (i.e. cart-line-items.liquid or a similar file). The key lines are as follows:

{% assign first_character_in_key = p.first | truncate: 1, '' %}
{% unless p.last == blank or first_character_in_key == '_' %}

This code should be implemented in a loop over each item property. In context, the code block may look something like the below:

{% assign property_size = item.properties | size %}
{% if property_size > 0 %}
ย  {% for p in item.properties %}
ย  ย  {% assign first_character_in_key = p.first | truncate: 1, '' %}
ย  ย  {% unless p.last == blank or first_character_in_key == '_' %}
ย  ย  ย  {{ p.first }}:
ย  ย  ย  {% if p.last contains '/uploads/' %}
ย  ย  ย  ย  <a href="{{ p.last }}">{{ p.last | split: '/' | last }}</a>
ย  ย  ย  {% else %}
ย  ย  ย  ย  {{ p.last }}
ย  ย  ย  {% endif %}
ย  ย  {% endunless %}
ย  {% endfor %}
{% endif %}

You can learn more about this here under 'Hide line item properties (optional)'.

Displaying the Correct Strikethrough Price in the Cart

Typically, you should not tag any prices within your cart while completing "Step 2: Tag your prices". However, if you do display a strikethrough price in the cart, you will want to tag that to ensure the correct strikethrough price shows up for each group.

Last updated