I have a problem with adding the add to cart button. Whenever I add the add to cart button the all of the sliders disapear from page. This is the example where I use the add to cart button .
<h2>Compilations</h2>
<div id="owl-demo6" class="owl-carousel">
<?php
$categoryId = 2; // this is the category holding your products
$products = Mage::getModel('catalog/product')->getCollection();
$products->addAttributeToSelect(array(
'image',
'name',
'short_description',
'sku',
'asin'
))
->addFieldToFilter('visibility', array(
Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG
));
//$products->load();
foreach ($products as $product) : ?>
<div class="item">
<img src="<?php echo $localHelper->getImageUrl($product); ?>" alt="img" />
<?php if (!$product->getTypeInstance(true)->hasRequiredOptions($product)):?>
<button type="button" title="<?php echo $this__('Add to Cart') ?>"
class="button btn-cart" onclick="setLocation('<?php echo $this->helper('checkout/cart')->getAddUrl($product); ?>')">
<span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
<script>
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery("#owl-demo").owlCarousel({
items : 4,
lazyLoad : true,
navigation : true
});
If anyone could spot what I'm missing would be great. Thank you