> For the complete documentation index, see [llms.txt](https://docs.voordemensen.nl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.voordemensen.nl/api/manual-integration/cart-and-counter.md).

# Cart & Counter

There are two ways to manually get the numbers of items in a basket.&#x20;

1. The preferred way would be to make an AJAX call to [the API public endpoint for cart](/api/public-endpoints/cart.md#get-items-in-cart) and loop over the elements to count the numberoftickets key\
   \
   Example HTML:\
   \
   `Tickets in your basket: <span id="basket"></span>`\
   \
   Example Jquery Javascript:<br>

   ```
   $.get( "https://tickets.voordemensen.nl/api/demo/cart/52c5acccccb852328deb1345b1ee9672", function( data ) {  
       numberoftickets=0;
       data.forEach(function(data) {
           if(!isNaN(data.numberoftickets)) numberoftickets=numberoftickets+data.numberoftickets;
       });
       $( "#basket" ).html(numberoftickets);  
   });

   ```

   <br>
2. Or request the plain number by making a call to \
   \
   `https://tickets.voordemensen.nl/client_name/event/cartnr?murmur=cartid`\
   \
   This call will return a plain number you can display anywhere. <br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.voordemensen.nl/api/manual-integration/cart-and-counter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
