Hi, I'm building a widget that offers support to customers regarding products. For this, I need to list the products available in a page, that a customer is on.
So far my plan is to:
Is there a better way to get this done? Am I misusing the Sales Channel option?
I discovered an alternative method to get the products shown on current page.
You can inject a small piece of code in the liquid files that render a product into view. Code example:
The challenge is to inject this code to all template files that render a single product. Right now, I'm thinking of doing a wildcard search and inject the code to all template files that have the substring "product" in their titles.
The injection can be done by the REST API Asset endpoints
It would be great if someone could give their opinion on this approach.