
<?php
/**
 * Cart cross sell items template
 *
 * @see Mage_Checkout_Block_Cart_Crosssell
 */
?>
<?php if($this->getItemCount()): ?>
<div class="crosssel">
  
    <h2><?php echo $this->__('Based on your selection, you may be interested in the following items:') ?></h2>
  <div class="category-products">

    <ul id="crosssell-products-list" class="products-grid first odd">
    <?php foreach ($this->getItems() as $_item): ?>
        <li class="item">

        <div class="item-inner">
     <div class="product-block">
        <div class="product-image">
          <a href="<?php echo $_item->getProductUrl() ?>">
            <figure class="product-display">
          <?php echo $this->helper('amazesettings')->getLabel($_item);  ?>
          <img class="lazyOwl product-mainpic" src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(265,322) ?>" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" />
          <img class="product-secondpic" src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(265,322) ?>" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" />
            </figure>
          </a>
        </div> <!--product-image-->
        <div class="product-meta">
           <div class="product-action">
              <?php if($_item->isSaleable()): ?>
                <a href="<?php echo $this->getAddToCartUrl($_item) ?>" class="addcart"> <i class="icon-shopping-cart">&nbsp;</i><?php echo $this->__('Add to Cart') ?></a>
              <?php else: ?>
                <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
              <?php endif; ?>
              <a href="<?php echo $this->helper('wishlist')->getAddUrl($_item) ?>" class="wishlist" title="<?php echo $this->__('Add to Wishlist');?>"><i class="icon-heart">&nbsp;</i></a>
              <?php if(Mage::app()->getStore()->getConfig('amazesettings/amazesettings_quickview/enable')==1){?>
                  <a data-fancybox-type="ajax" onclick="callQuickView('<?php echo Mage::getUrl('amazesettings/index/view/id/'.$_item->getId());?>');" title="<?php echo $this->__('Quick View') ?>" class="quickview"><i class="icon-zoom">&nbsp;</i></a>                    
              <?php }  ?>   
           </div> <!--product-action-->
        </div> <!--product-meta-->
     </div> <!--product-block-->

     <div class="item-info">
       <div class="info-inner">
          <div class="item-title">
            <a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_item->getName()) ?>">
                  <?php $prod_name = $this->htmlEscape($_item->getName()) ; 
                  if(strlen($prod_name) > 30) {echo substr($prod_name,0,30)."...";}else {echo $prod_name;}?>
            </a>
          </div> <!--item-title-->
          <div class="item-content">
            <div class="item-price">
              <?php echo $this->getPriceHtml($_item, true) ?>
            </div> <!--item-price-->
                    <?php
                        $summaryData = Mage::getModel('review/review_summary')
                                ->setStoreId($storeId)
                                ->load($_item->getId());
                        if($summaryData->getRatingSummary()) { ?>
                          <div class="rating">
                            <div class="ratings">
                                <div class="rating-box">
                                        <div class="rating" style="width: <?php echo $summaryData->getRatingSummary().'%'; ?>"></div>
                                </div> <!--rating-box-->
                            </div> <!--ratings-->
                          </div> <!--rating-->
                    <?php } else { ?>  
                            <div class="rating"><div class="ratings"><div class="rating-box"><div style="width:0%" class="rating"></div></div></div></div>
                    <?php } ?>
          </div> <!--item-content-->
       </div> <!--info-inner-->
     </div> <!--item-info-->
   </div> <!--item-inner-->
                   
        </li>
    <?php endforeach; ?>
    </ul>
    <script type="text/javascript">decorateList('crosssell-products-list', 'none-recursive')</script>
</div><!--category-products-->
</div>  <!--crosssell-->
<?php endif; ?>

<div id="mgkquickview">
<div id="magikloading" style="display:none;text-align:center;margin-top:400px;"><img src="<?php echo $this->getSkinUrl('images/mgkloading.gif');?>" alt="loading">
</div></div>
<script type="text/javascript">
function callQuickView(qurl) { 
    jQuery('#mgkquickview').show();
    jQuery('#magikloading').show();
    jQuery.get(qurl, function(data) {
      jQuery.fancybox(data);
      jQuery('#magikloading').hide();
jQuery('#mgkquickview').hide();
    });
 }
 
</script>