Advertisement
vikasrao999

list.phtml

Jul 9th, 2014
812
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.32 KB | None | 0 0
  1. <?php
  2. /**
  3. * Magento
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Academic Free License (AFL 3.0)
  8. * that is bundled with this package in the file LICENSE_AFL.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/afl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@magentocommerce.com so we can send you a copy immediately.
  14. *
  15. * DISCLAIMER
  16. *
  17. * Do not edit or add to this file if you wish to upgrade Magento to newer
  18. * versions in the future. If you wish to customize Magento for your
  19. * needs please refer to http://www.magentocommerce.com for more information.
  20. *
  21. * @category design
  22. * @package base_default
  23. * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
  24. * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
  25. */
  26. ?>
  27. <?php
  28. /**
  29. * Product list template
  30. *
  31. * @see Mage_Catalog_Block_Product_List
  32. */
  33. ?>
  34. <?php
  35. $_productCollection=$this->getLoadedProductCollection();
  36. $_helper = $this->helper('catalog/output');
  37.  
  38. $setting = Mage::helper('galagiftshopsettings');
  39. $pageLayout = substr((str_replace(array('page/','.phtml'),'',Mage::app()->getLayout()->getBlock('root')->getTemplate())),0,1);
  40. $_columnCount = $setting->getProductsGrid_Twocolumns(3);
  41. if ($pageLayout == 3) $_columnCount = $setting->getProductsGrid_Threecolumns(2);
  42. if ($pageLayout == 1) $_columnCount = $setting->getProductsGrid_Onecolumn(4);
  43. ?>
  44. <?php if(!$_productCollection->count()): ?>
  45. <p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
  46. <?php else: ?>
  47. <div class="category-products">
  48. <?php echo $this->getToolbarHtml() ?>
  49. <?php // List mode ?>
  50. <?php if($this->getMode()!='grid'): ?>
  51. <?php $_iterator = 0; ?>
  52. <ol class="products-list" id="products-list">
  53. <?php foreach ($_productCollection as $_product): ?>
  54. <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
  55. <?php // Product Image ?>
  56. <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
  57. <?php echo $setting->getLabelProducts($_product->getId()) ?>
  58. <img
  59. src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(290,290); ?>"
  60. <?php if ($alt_img = $setting->getProductsList_AltImg()): ?>
  61. rel="<?php echo $alt_img ?>"
  62. data-alt-src="<?php echo $this->helper('catalog/image')->init($_product, $alt_img)->resize(290,290); ?>"
  63. <?php endif ?>
  64. alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
  65. </a>
  66. <?php // Product description ?>
  67. <div class="product-shop">
  68. <div class="f-fix">
  69. <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
  70. <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
  71. <?php if($_product->getRatingSummary()): ?>
  72. <?php echo $this->getReviewsSummaryHtml($_product) ?>
  73. <?php endif; ?>
  74. <div class="desc std">
  75. <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
  76. <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
  77. </div>
  78. <?php echo $this->getPriceHtml($_product, true) ?>
  79. <div class="addtobox">
  80. <?php if($_product->isSaleable()): ?>
  81. <p class="btn-cart"><button type="button" title="<?php echo $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>
  82. <?php else: ?>
  83. <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
  84. <?php endif; ?>
  85. <ul class="add-to-links">
  86. <?php if ($this->helper('wishlist')->isAllow()) : ?>
  87. <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist" title="<?php echo $this->__('Add to Wishlist') ?>"><?php echo $this->__('Add to Wishlist') ?></a></li>
  88. <?php endif; ?>
  89. <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
  90. <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare" title="<?php echo $this->__('Add to Compare') ?>"><?php echo $this->__('Add to Compare') ?></a></li>
  91. <?php endif; ?>
  92. </ul>
  93. </div>
  94. </div>
  95. </div>
  96. </li>
  97. <?php endforeach; ?>
  98. </ol>
  99. <script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
  100.  
  101. <?php else: ?>
  102.  
  103. <?php // Grid Mode ?>
  104.  
  105. <?php $_collectionSize = $_productCollection->count() ?>
  106. <?php $i=0; foreach ($_productCollection as $_product): ?>
  107. <?php if ($i++%$_columnCount==0): ?>
  108. <ul class="products-grid products-grid-<?php echo $_columnCount; ?>">
  109. <?php endif ?>
  110. <li class="item<?php if(($i-1)%$_columnCount==0): ?> alpha<?php elseif($i%$_columnCount==0): ?> omega<?php endif; ?>">
  111. <div class="product-item">
  112. <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
  113. <?php echo $setting->getLabelProducts($_product->getId()) ?>
  114. <img
  115. src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(290,290); ?>"
  116. <?php if ($alt_img = $setting->getProductsGrid_AltImg()): ?>
  117. rel="<?php echo $alt_img ?>"
  118. data-alt-src="<?php echo $this->helper('catalog/image')->init($_product, $alt_img)->resize(290,290); ?>"
  119. <?php endif ?>
  120. alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
  121. </a>
  122.  
  123. <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
  124. <?php if($_product->getRatingSummary()): ?>
  125. <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
  126. <?php endif; ?>
  127. <?php echo $this->getPriceHtml($_product, true) ?>
  128. <div class="actions">
  129. <?php if($_product->isSaleable()): ?>
  130. <button type="button" title="<?php echo $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>
  131. <?php else: ?>
  132. <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
  133. <?php endif; ?>
  134. <ul class="add-to-links">
  135. <?php if ($this->helper('wishlist')->isAllow()) : ?>
  136. <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist" title="<?php echo $this->__('Add to Wishlist') ?>"><?php echo $this->__('Add to Wishlist') ?></a></li>
  137. <?php endif; ?>
  138. <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
  139. <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare" title="<?php echo $this->__('Add to Compare') ?>"><?php echo $this->__('Add to Compare') ?></a></li>
  140. <?php endif; ?>
  141. </ul>
  142. </div>
  143. </div>
  144. </li>
  145. <?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
  146. </ul>
  147. <?php endif ?>
  148. <?php endforeach ?>
  149. <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
  150. <?php endif; ?>
  151.  
  152. <div class="toolbar-bottom">
  153. <?php echo $this->getToolbarHtml() ?>
  154. </div>
  155. </div>
  156. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement