Topic by Marko B.
Content
I am trying to retrieve the products associated IDs to a category.
In order to this, I defined a model function called getProduct() that applies a ROQL query and returns a product objects array linked to an specific category (the category
ID is hardcoded).
Also I defined the controller function getProductID() that calls to that model function and assigns the return array in a variable. After to this, the function gets each array object and assign it ID to another array. The final array is returned.
When I test it in the browser, I expect to see the products IDs, but the page is empty.
Can anyone say me what is wrong in the model and controller functions code?
These codes are shown below. Also I attached a browser screenshot. Any help or suggestion is useful.
Thank you in advance,
Regards.
Code Block
Image
