I need to display a single product inside some blocks. My problem is: If I use the code in two blocks, each one with its own product ID, the first block will show correctly but the second block will show the same product and not the ID that I have chosen for the second block.
This is what I have so far:
At the block:
{{block type="catalog/product_view" product_id="xx" template="catalog/product/single.phtml"}}
At Template/catalog/product/single.phtml:
<?php
$_helper = $this->helper('catalog/output');
$_product = $this->getProduct();
$productId = $this->getProduct_id();
$product = Mage::getModel('catalog/product')->load($productId);
?>
<a href="<?php echo $product->getProductUrl() ?>" ><div class="menu_product">
<h2><?php echo $_helper->productAttribute($_product, $this->htmlEscape($_product->getName()), 'name') ?></h2>
<span><b><?php echo $this->getPriceHtml($_product) ?></b></span>
<img class="product-img" src="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(145, 145); ?>" width="145" height="145" alt="<?php echo $this->htmlEscape($product->getName()) ?>" />
</div></a>