You need to look into this page (
<path_to_your_template_folder>/template/catalog/product/list.phtml) carefully. You will find the following lines of code in different places of this page only:-
$_productCollection = $this->getLoadedProductCollection(); foreach ($_productCollection as $_product): $reqProductId = $_product->getId(); endforeach;
If you carefully match the above code & the code in the above-mentioned page, you will know that you need to use the variable "
$reqProductId" properly in your required "
INPUT" element of type "
hidden". So you will require it to do your part in the main "
Hope it helps.