<?php
$_productCollection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('*');
?>
<table>
<tr>
<th class="prosku">Sku</th>
<th class="proname">Name</th>
<th class="proprice">Price</th>
<th class="proimg">Thumbnail</th>
<th class="pro-button">Add to Cart Button</th>
</tr>
<?php
if(count($_productCollection))
{
foreach($_productCollection as $product)
{
?>
<tr>
<td class="prodsku"><?php echo $product->getSku(); ?></td>
<td class="prodname"><?php echo $product->getName();?></td>
<td class="prodprice"><?php echo $product->getPrice();?></td>
<td class="prodimg"><img src="<?php echo $product->getImageurl[];?>" width="100px" height="100px"/></td>
 

<!--   add to cart button -->


<td class="prod-add_to_Cart-button">

<?php if($product->isSaleable()): ?>

<p>

<button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Add to Cart')) ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCarturl[$product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
</p>
<?php else: ?>
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock'] ?></span></p>
<?php endif; ?></td>
</tr>
<?php
}
}
?>
</table>
<style type="text/css">
.prodsku, .prodname, .prodprice, .prodimg, .prod-add_to_Cart-button{
padding:10px;
}
.prosku, .proname, .proprice, .proimg, .pro-button{
padding:10px;
}
</style>



Created: 09/08/2018
Visits: 125
Online: 0