“Current cart status” tag

 

Cet article est actuellement disponible en anglais et en espagnol. Vous pouvez vous servir de cette documentation en attendant qu'elle soit disponible dans votre langue.

The “Current shopping cart status” tag is a snippet of HTML code used to describe the contact’s current shopping cart.  

  

This article is part of the guide to creating a custom integration.
If your integration is via a module, this tag will be added to your ecommerce platform automatically.

 

What is this tag and where is it used?

The “cn_cart” tag should be inserted on every page whenever a change is made to the cart.

 

Properties

The different properties of a cart must be defined within the “cn_cart” tag as child tags, indicating the name of the property in the “class” attribute.

Each different product in the cart is indicated by a tag with the class “product_basket_item”, which includes their quantity and amount.

 

Find more information about the Product Basket Item object in this article.

The properties to be included in the tag are:

Name Required Type Multiple Description
total_price

Yes

decimal

No

Total cart amount.

product_basket_item

No

Product Basket Item

Yes

Items contained in the cart, together with their quantity and the amount.

cart_id

Yes

string

No

Unique identifier for the cart.

total_quantity

Yes

string

No

Total number of products in the cart (including duplicates).
For example: if a cart has three units of one product and seven of another, total_quantity will be equal to 10.

 

Although optional, we recommend using the “cart_id” field to change the status of the cart to purchased and avoid incorrect Abandoned Cart events.

 

Other considerations

You must include the cart without products tag when the cart has been emptied. This way, the cart won’t be considered abandoned when it doesn’t not contain any products.

 

Example

Once the properties are included, the tag will look like this:

<div class="cn_cart" style="display:none">
<span class="cart_id">crt8679803</span>
<span class="total_quantity">3</span>
<span class="total_price">180.75</span>
<div class="product_basket_item">
<span class="quantity">3</span>
<span class="price">180.75</span>
<span class="url">http://example.org/products/pr9658</span>
<span class="product_id">pr9658</span>
<span class="name">Teclado Gaming Logitech Pro v.1.5</span>
<span class="description">Teclado inalámbrico retroiluminado de alta gama, personalizable y resistente a líquidos y caídas.</span>
<span class="image_url">http://example.org/img/products/pr9658.jpg</span>
<span class="unit_price">60.25</span>
<span class="availability">InStock</span>
<span class="category">/Ordenadores/Teclados/Logitech</span>
<span class="category">/Ordenadores/Gaming</span>
<span class="tag">Azul</span>
<span class="tag">Gaming</span>
<span class="tag">Retroiluminado</span>
<span class="tag">Inalámbrico</span>
<span class="brand">Logitech</span>
<span class="review_count">9</span>
<span class="rating_value">4.5</span>
<span class="thumbnail_url">http://example.org/img/thumbnails/products/pr9658.jpg</span>
<span class="related_external_product_id">pr10636</span>
<span class="related_external_product_id">pr11939</span>
<span class="related_external_product_id">pr12653</span>
<span class="published_at">2020-05-20T15:24:20Z</span>
<span class="custom_field_1">Información personalizada de ejemplo</span>
</div>
</div>

 

 

Congratulations!
You’ve reached the end of the tutorial.

  

Do you have questions?
Don’t forget, our Connectif specialists are here to help you. To contact them, just open a Support ticket by clicking the blue “Help” button on your dashboard.


Keep learning!

To make the most of your Connectif account, we recommend reading these articles next:

Cet article vous a-t-il été utile ?
Utilisateurs qui ont trouvé cela utile : 0 sur 0