I'm trying to implement "Display more pages" button using jQuery ajax and twig template.
My javascript looks like
$.ajax({
url: "/products.json.twig",
method: "GET",
data: { index: "0" }, //page index to show
success: function (data) {
....
Is it possible to read somehow data parameter in products.json.twig using twig? If not, how should I solve this problem? Thanks in advance!