I understand we can expose a function as part of context and hence we can trigger this addToCart event from builder.io UI console.
But how do I pass this currentProduct? where do I get this currentProduct info from?
Consider, I have a product list page - which has list of all product and each product has “Add To Cart” button.
Yes, you can use data binding and event binding to bind product reference. Then using click event, pass the object reference to the context addToCart function. You can refer to the below linked articles for reference.