What's New
Viewing 9 posts - 1 through 9 (of 9 total)
Viewing 9 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic.
Hello,
Thank you for your replies.
We need the data of the products loaded in the category pages to generate a datalayer (a javascript variable with product data).
It is easy to generate it on the category first page load, we can do it server side.
But when the user clicks on next / previous page, the products are fetched from ajax request, so we need to capture the ajax page loading event, and the data loaded (at least the list of product ids, to make a new request to fetch the product data, but if we can have all the data directly it will be more efficient).
Thank you for your help.
Regards
Hello,
Thank you for your replies.
We need the data of the products loaded in the category pages to generate a datalayer (a javascript variable with product data).
It is easy to generate it on the category first page load, we can do it server side.
But when the user clicks on next / previous page, the products are fetched from ajax request, so we need to capture the ajax page loading event, and the data loaded (at least the list of product ids, to make a new request to fetch the product data, but if we can have all the data directly it will be more efficient).
Thank you for your help.
Regards
@jonny can You help?
1. Use the “filterProductSearch” hook to add the javascript variable with product data to the Ajax response data.
2. Use this “updateProductList” js event to update the existing javascript variable.
See the attached pics, the “data” variable in JS is the “searchVariables” variable in PHP.
You must be logged in to reply to this topic.