Guest User

Untitled

a guest
Oct 23rd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.32 KB | None | 0 0
  1. <?php
  2. $ajaxcart = Mage::getStoreConfig('mygeneral/product_list/ajaxcart');
  3. $newsaleicon = Mage::getStoreConfig('mygeneral/product_list/newsaleicon');
  4. $display_productname_singleline = Mage::getStoreConfig('mygeneral/product_list/display_productname_singleline');
  5. $image_aspect_ratio = Mage::getStoreConfig('mygeneral/product_list/image_aspect_ratio');
  6. $lazyload = Mage::getStoreConfig('mygeneral/product_slider/lazyload');
  7. $instance = Mage::helper("ExtraConfig");
  8.  
  9. $imgWidth = 540;
  10. if($image_aspect_ratio == '1'){
  11. $imgHeight = 0;
  12. } else {
  13. $imgHeight = 720;
  14. }
  15.  
  16. ?>
  17. <?php if($this->getItemCount()): ?>
  18. <div class="crosssell">
  19. <div class="section-line">
  20. <h2><?php echo $this->__('Crosssell Products') ?></h2>
  21. </div>
  22.  
  23. <div id="crosssellproduct" class="products-grid itemslider">
  24. <?php $i=0;$j=0; foreach ($this->getItems() as $_item): ?>
  25.  
  26. <div class="item">
  27.  
  28. <div class="product-image-wrapper">
  29.  
  30. <?php if($newsaleicon == '1') { ?>
  31. <?php $adate = date('Y-m-d'); //echo 'frpm:-'.$_item->special_from_date.'----';echo "to:-".$_item->special_to_date.'--';
  32. $a= 0;
  33. if($_item->special_from_date != null && $_item->special_to_date == "")
  34. {
  35. if( $adate >= $_item->special_from_date)
  36. {
  37. $a = 1;
  38. }
  39. }
  40. if($_item->special_from_date != "" && $_item->special_to_date != "")
  41. {
  42. if($adate >= $_item->special_from_date && $adate <= $_item->special_to_date)
  43. {
  44. $a = 1;
  45. }
  46. }
  47.  
  48. if($a == 1){ ?>
  49. <div class="sale"><label><?php echo $this->__('SALE') ?></label></div>
  50. <?php } ?>
  51.  
  52.  
  53. <?php $bdate = date('Y-m-d');
  54. $b= 0;
  55. if($_item->news_from_date != null && $_item->news_to_date == "")
  56. {
  57. if( $bdate >= $_item->news_from_date)
  58. {
  59. $b = 1;
  60. }
  61. }
  62. if($_item->news_from_date != "" && $_item->news_to_date != "")
  63. {
  64. if($bdate >= $_item->news_from_date && $bdate <= $_item->news_to_date)
  65. {
  66. $b = 1;
  67. }
  68. }
  69. if($b == 1){ ?>
  70. <div class="new"><label><?php echo $this->__('NEW') ?></label></div>
  71. <?php }
  72. ?>
  73. <?php } ?>
  74.  
  75. <?php
  76. $class = "";
  77.  
  78. $alterImage = Mage::helper("ExtraConfig")->getAltImgHtml($_item, $imgWidth, $imgHeight,'thumbnail');
  79.  
  80. if($alterImage != false)
  81. {
  82. $class = 'small-image';
  83. }
  84. ?>
  85. <a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_item, 'small_image'), null, true) ?>" class="product-image">
  86. <?php if($lazyload): ?>
  87. <img class="lazyOwl <?php echo $class; ?>" data-src="<?php echo $instance->getImage($_item, $imgWidth, $imgHeight, 'small_image'); ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_item, 'small_image'), null, true); ?>" />
  88. <?php else: ?>
  89. <img class="<?php echo $class; ?>" src="<?php echo $instance->getImage($_item, $imgWidth, $imgHeight, 'small_image'); ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_item, 'small_image'), null, true); ?>" />
  90. <?php endif; ?>
  91. <?php echo $alterImage; ?>
  92. </a>
  93.  
  94. <div id='ajax_loader<?php echo $_item->getId()?>' class="ajaxcartpro_progress" style="display: none;"></div>
  95.  
  96. <div class="actions">
  97. <div class="btn-cart">
  98. <?php if($_item->isSaleable()): ?>
  99. <?php if($ajaxcart == '1') { ?>
  100. <?php if ( !($_item->getTypeInstance(true)->hasRequiredOptions($_item) || $_item->isGrouped()) ) { ?>
  101. <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart ajx-cart" onclick="setLocationAjax('<?php echo $this->getAddToCartUrl($_item) ?>','<?php echo $_item->getId()?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
  102. <?php } else { ?>
  103. <?php if(Mage::helper("ExtraConfig")->is_mobile() == false) { ?>
  104. <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="showOptions('<?php echo $_item->getId()?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
  105. <a href='<?php echo $this->getUrl('ajax/index/options',array('product_id'=>$_item->getId()));?>' class='fancybox' id='fancybox<?php echo $_item->getId()?>' style='display:none'></a>
  106. <?php } else { ?>
  107. <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_item) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
  108. <?php } ?>
  109. <?php } ?>
  110. <?php } else { ?>
  111. <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_item) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
  112. <?php } ?>
  113. <?php else: ?>
  114. <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
  115. <?php endif; ?>
  116. </div>
  117.  
  118. <ul class="add-to-links addto-links-icons">
  119. <?php if($ajaxcart == '1') { ?>
  120. <li class="first">
  121. <a href='<?php echo $this->getUrl('ajax/index/options',array('product_id'=>$_item->getId()));?>' class='fancybox tooltip_container' id='quickview-fancybox<?php echo $_item->getId()?>'><span class="icon fa fa-search-plus"></span><span class="tooltip"><?php echo $this->__('Quick View') ?></span></a>
  122. </li>
  123. <?php } ?>
  124. <li>
  125. <?php if($_compareUrl=$this->getAddToCompareUrl($_item)): ?>
  126. <a href="<?php echo $_compareUrl ?>" title="<?php echo $this->__('Add to Compare') ?>" class="link-compare tooltip_container"><span class="icon fa fa-exchange"></span><span class="tooltip"><?php echo $this->__('Add to Compare') ?></span></a>
  127. <?php endif; ?>
  128. </li>
  129. <li class="last">
  130. <?php if ($this->helper('wishlist')->isAllow()) : ?>
  131. <a href="<?php echo $this->helper('wishlist')->getAddUrl($_item) ?>" title="<?php echo $this->__('Add to Wishlist') ?>" class="link-wishlist tooltip_container"><span class="icon fa fa-star"></span><span class="tooltip"><?php echo $this->__('Add to Wishlist') ?></span></a>
  132. <?php endif; ?>
  133. </li>
  134. </ul>
  135. </div>
  136.  
  137. </div>
  138.  
  139. <div class="product-content-wrapper">
  140. <div class="product-content">
  141. <h3 class="product-name<?php if($display_productname_singleline == '1'){ ?> single-line-name<?php } ?>"><a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->stripTags($_item->getName(), null, true) ?>"><?php echo $this->htmlEscape($_item->getName()); ?></a></h3>
  142. <div class="vert">
  143. <?php echo $this->getPriceHtml($_item, true) ?>
  144. </div>
  145. <?php echo $this->getReviewsSummaryHtml($_item, false, true); ?>
  146. </div>
  147. </div>
  148.  
  149. </div>
  150. <?php endforeach ?>
  151. </div>
  152.  
  153. <script type="text/javascript">decorateList('crosssell-products-list', 'none-recursive')</script>
  154.  
  155. </div>
  156.  
  157. <script type="text/javascript">
  158. //<![CDATA[
  159. jQuery(function(j$) {
  160. j$("#crosssellproduct").owlCarousel({
  161. itemsCustom : [
  162. [0, 1],
  163. [380, 2],
  164. [751, 4],
  165. [1265, 4],
  166. [1360, 4],
  167. [1440, 4],
  168. [1680, 4]
  169. ]<?php echo Mage::helper("ExtraConfig")->sliderSetting(); ?>
  170. });
  171. });
  172. //]]>
  173. </script>
  174.  
  175. <?php endif; ?>
Add Comment
Please, Sign In to add comment