Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.
For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email firstname.lastname@example.org.
Is there a variable I can use to pull the product id (or some other unique identifier) on the product page? I want to display an image depending on what product it is (1 through 4) so I was going to do something like <img src="images/<? $id ?>” alt="image" /> but I’m not what var to use.
Try using <img src="images/<?=$_product->getId()?>" alt=""/>. Or, you could change it to use the sku with getSku.
Edit: I thought that I should mention that you’d obviously need to declare the image type after the product id. So you it should probably look like:
<img src="images/<?=$_product->getId()?>.jpg" alt=""/> or whatever your image extension is.