Guest User

Untitled

a guest
Apr 23rd, 2018
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.98 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@magento.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.magento.com for more information.
  20. *
  21. * @category design
  22. * @package rwd_default
  23. * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.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. /* @var $this Mage_Catalog_Block_Product_List */
  34. ?>
  35. <?php
  36. $_productCollection=$this->getLoadedProductCollection();
  37. $_helper = $this->helper('catalog/output');
  38. ?>
  39. <?php if(!$_productCollection->count()): ?>
  40. <p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
  41. <?php else: ?>
  42. <div class="category-products">
  43. <?php echo $this->getToolbarHtml() ?>
  44. <?php // List mode ?>
  45. <?php if($this->getMode()!='grid'): ?>
  46. <?php $_iterator = 0; ?>
  47. <ol class="products-list" id="products-list">
  48. <?php foreach ($_productCollection as $_product): ?>
  49. <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
  50. <?php // Product Image ?>
  51. <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
  52. <?php /* Based on the native RWD styling, product images are displayed at a max of ~400px wide when viewed on a
  53. one column page layout with four product columns from a 1280px viewport. For bandwidth reasons,
  54. we are going to serve a 300px image, as it will look fine at 400px and most of the times, the image
  55. will be displayed at a smaller size (eg, if two column are being used or viewport is smaller than 1280px).
  56. This $_imgSize value could even be decreased further, based on the page layout
  57. (one column, two column, three column) and number of product columns. */ ?>
  58. <?php $_imgSize = 300; ?>
  59. <img id="product-collection-image-<?php echo $_product->getId(); ?>"
  60. src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->keepFrame(false)->resize($_imgSize); ?>"
  61. alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
  62. </a>
  63. <?php // Product description ?>
  64. <div class="product-shop">
  65. <div class="f-fix">
  66. <div class="product-primary">
  67. <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
  68. <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
  69. <?php if($_product->getRatingSummary()): ?>
  70. <?php echo $this->getReviewsSummaryHtml($_product) ?>
  71. <?php endif; ?>
  72. <?php
  73. // Provides extra blocks on which to hang some features for products in the list
  74. // Features providing UI elements targeting this block will display directly below the product name
  75. if ($this->getChild('name.after')) {
  76. $_nameAfterChildren = $this->getChild('name.after')->getSortedChildren();
  77. foreach ($_nameAfterChildren as $_nameAfterChildName) {
  78. $_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
  79. $_nameAfterChild->setProduct($_product);
  80. echo $_nameAfterChild->toHtml();
  81. }
  82. }
  83. ?>
  84. </div>
  85. <div class="product-secondary">
  86. <?php echo $this->getPriceHtml($_product, true) ?>
  87. </div>
  88. <div class="product-secondary">
  89. <?php if(!$_product->canConfigure() && $_product->isSaleable()): ?>
  90. <p class="action"><button type="button" title="<?php echo $this->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>
  91. <?php elseif($_product->getStockItem() && $_product->getStockItem()->getIsInStock()): ?>
  92. <p class="action"><a title="<?php echo $this->quoteEscape($this->__('View Details')) ?>" class="button" href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->__('View Details') ?></a></p>
  93. <?php else: ?>
  94. <p class="action availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
  95. <?php endif; ?>
  96. <ul class="add-to-links">
  97. <?php if ($this->helper('wishlist')->isAllow()) : ?>
  98. <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
  99. <?php endif; ?>
  100. <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
  101. <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
  102. <?php endif; ?>
  103. </ul>
  104. </div>
  105. <div class="desc std">
  106. <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
  107. <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
  108. </div>
  109. </div>
  110. </div>
  111. </li>
  112. <?php endforeach; ?>
  113. </ol>
  114. <script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
  115.  
  116. <?php else: ?>
  117.  
  118. <?php // Grid Mode ?>
  119.  
  120. <?php $_collectionSize = $_productCollection->count() ?>
  121. <?php $_columnCount = $this->getColumnCount(); ?>
  122. <ul class="products-grid products-grid--max-<?php echo $_columnCount; ?>-col">
  123. <?php $i=0; foreach ($_productCollection as $_product): ?>
  124. <?php /*if ($i++%$_columnCount==0): ?>
  125. <?php endif*/ ?>
  126. <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
  127. <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
  128. <?php $_imgSize = 210; ?>
  129. <img id="product-collection-image-<?php echo $_product->getId(); ?>"
  130. src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($_imgSize); ?>"
  131. alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
  132. </a>
  133. <div class="product-info">
  134. <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>
  135. <?php
  136. // Provides extra blocks on which to hang some features for products in the list
  137. // Features providing UI elements targeting this block will display directly below the product name
  138. if ($this->getChild('name.after')) {
  139. $_nameAfterChildren = $this->getChild('name.after')->getSortedChildren();
  140. foreach ($_nameAfterChildren as $_nameAfterChildName) {
  141. $_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
  142. $_nameAfterChild->setProduct($_product);
  143. echo $_nameAfterChild->toHtml();
  144. }
  145. }
  146. ?>
  147. <?php //echo $this->getPriceHtml($_product, true) ?>
  148. <?php if($_product->getRatingSummary()): ?>
  149. <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
  150. <?php endif; ?>
  151. <div class="actions">
  152. <?php echo $this->getPriceHtml($_product, true) ?>
  153. <?php if(!$_product->canConfigure() && $_product->isSaleable()): ?>
  154. <button type="button" title="<?php echo $this->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>
  155. <?php elseif($_product->getStockItem() && $_product->getStockItem()->getIsInStock()): ?>
  156. <a title="<?php echo $this->quoteEscape($this->__('View Details')) ?>" class="button" href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->__('View Details') ?></a>
  157. <?php else: ?>
  158. <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
  159. <?php endif; ?>
  160. <ul class="add-to-links">
  161. <?php if ($this->helper('wishlist')->isAllow()) : ?>
  162. <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
  163. <?php endif; ?>
  164. <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
  165. <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
  166. <?php endif; ?>
  167. </ul>
  168. </div>
  169. </div>
  170. </li>
  171. <?php /*if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
  172. <?php endif*/ ?>
  173. <?php endforeach ?>
  174. </ul>
  175. <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
  176. <?php endif; ?>
  177.  
  178. <div class="toolbar-bottom">
  179. <?php echo $this->getToolbarHtml() ?>
  180. </div>
  181. </div>
  182. <?php endif; ?>
  183. <?php
  184. // Provides a block where additional page components may be attached, primarily good for in-page JavaScript
  185. if ($this->getChild('after')) {
  186. $_afterChildren = $this->getChild('after')->getSortedChildren();
  187. foreach ($_afterChildren as $_afterChildName) {
  188. $_afterChild = $this->getChild('after')->getChild($_afterChildName);
  189. //set product collection on after blocks
  190. $_afterChild->setProductCollection($_productCollection);
  191. echo $_afterChild->toHtml();
  192. }
  193. }
  194. ?>
Add Comment
Please, Sign In to add comment