# Sending shopping cart events using library

**Update Cart**

Workflow start when **Update Cart** event happens. This event can be triggered when the subscriber adds the product to the cart or visits products. Then the workflow will wait a specific period of time before sent.

```markup
<script>
    sarepush('updateCart', {}, function (response) {
        console.log(response);
    });
</script>
```

Additionally you can enrich the event with product data that can be used to personalize the message.&#x20;

```markup
<script>
    sarepush('updateCart', {
        product_id: 99
        product_price: "23$"
        product_name: "Green t-shirt"
    }, function (response) {
        console.log(response);
    });
</script>
```

**Complete Cart**

You can stop the workflow by send **Complete Cart** event. Should be done when the subscriber buys products.

```markup
<script>
    sarepush('completeCart', {}, function (response) {
        console.log(response);
    });
</script>.
```

{% content-ref url="../campaigns/personalization" %}
[personalization](https://push-help.sare.pl/campaigns/personalization)
{% endcontent-ref %}
