AJAX reload for snippets (e.g. offcanvas cart)

Hey there,

i am familiar with kirby and ajax. In the past i only used it specificly for on one page/template to load more content/paginations.

Now i have created an offcanvas cart, which is available on every single page as a snippet. I am storeing the productinformation in the sessionstorage and need to reload the list in the cart via Ajax, when a product is added.

Does anyone have a hint how to start this? Because the cart does not have its own template, how to call a .json corresponding to the snippet?

The easiest way would be to implement this via a route that you call from your JS

Thank you very much, i could solve it. That seems in generall easier, than having extra .json templates etc.