Advertisement
vikasrao999

Untitled

Jun 6th, 2014
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.73 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) 2011 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. <?php if(!$_productCollection->count()): ?>
  39. <p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
  40. <?php else: ?>
  41. <div class="category-products">
  42. <div class="toolbar-top">
  43. <?php echo $this->getToolbarHtml() ?>
  44. </div>
  45. <?php // List mode ?>
  46. <div class="yt-products-container clearfix">
  47. <?php if($this->getMode()!='grid'): ?>
  48. <?php $_iterator = 0; ?>
  49. <ol class="products-list row-fluid" id="products-list">
  50. <?php foreach ($_productCollection as $_product):?>
  51. <?php
  52. $count_input_qty++;
  53. $now = date("Y-m-d");
  54. $newsFrom= substr($_product->getData('news_from_date'),0,10);
  55. $newsTo= substr($_product->getData('news_to_date'),0,10);
  56. $specialprice = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialPrice();
  57.  
  58. ?>
  59. <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
  60. <?php // Product Image ?>
  61. <div class="item-inner">
  62. <div id="pl_imagebox" class="item-box">
  63. <div class="product-image">
  64. <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>">
  65. <?php
  66. if($newsFrom != ''){
  67. if (($now>=$newsFrom && $now<=$newsTo)||($now>=$newsFrom && $newsTo =='')){
  68. //echo "<span class='newproduct-grid'>new</span>"; ?>
  69. <div class='new-item'></div>
  70. <?php }
  71. }else{
  72. if(($newsTo != "") && $newsTo >= $now){
  73. ?>
  74. <div class='new-item'></div>
  75. <?php }
  76. }
  77. if ($specialprice){?>
  78. <div class='sale-item'><span><?php
  79. $saleof= abs(($specialprice/($_product->getPrice()))*100-100);
  80. print_r(floor($saleof));
  81. ?></span></div>
  82. <?php }
  83. ?>
  84. <img class="image-main" src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->keepAspectRatio(false)->resize(210,210); ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
  85. </a>
  86. </div>
  87. <!--<div class="product-wlist-cpare">
  88. <ul class="wishlist-listting">
  89. <?php if ($this->helper('wishlist')->isAllow()) : ?>
  90. <li>
  91. <span class="icon-heart"></span>
  92. <a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
  93. </li>
  94. <?php endif; ?>
  95. </ul>
  96. <ul class="compare-listting">
  97.  
  98. </ul>
  99. </div>
  100. <div class="bg-hover"></div>-->
  101. </div>
  102. <div class="pl_infobox">
  103. <div class="products-list-info ">
  104. <div class="item-box-footer" data-mobile="item-box-footer span4">
  105. <div class="item-box-content">
  106. <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
  107. <h2 class="product-name "><a class="fontcolor" href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
  108. <!--div class="stock-status">
  109. <?php //if ($_product->isAvailable()): ?>
  110. <?php //echo $this->__('Availability:') ?><p class="availability in-stock">
  111. <span><?php //echo $this->__('In stock') ?></span></p>
  112. <?php //else: ?>
  113. <?php //echo $this->__('Availability:') ?><p class="availability out-of-stock">
  114. <span><?php //echo $this->__('Out of stock') ?></span></p>
  115. <?php //endif; ?>
  116. </div-->
  117. <div class="ratings-wrap">
  118. <?php //if($_product->getRatingSummary()): ?>
  119. <?php echo $this->getReviewsSummaryHtml($_product, false, true); ?>
  120. <?php //endif; ?>
  121. </div>
  122.  
  123.  
  124. </div>
  125. </div>
  126. <!--<div class="span8" data-tablet="span12" data-normal="span12">-->
  127. <div class="box-main" data-mobile="box-main span4">
  128. <div class="box-price-review">
  129. <div class="price-wrapper">
  130. <!--span class="price-title"><?php //echo $this->__("price:"); ?></span-->
  131.  
  132. </div>
  133. <?php //echo $this->getReviewsSummaryHtml($_product, false, false)?>
  134. </div>
  135. <div class="desc std">
  136. <?php
  137. echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description');
  138. ?>
  139. <!-- a class="readmore" href="<?php //echo $_product->getProductUrl(); ?>">More detail</a-->
  140. </div>
  141. </div>
  142. <!--</div>-->
  143.  
  144. <div class="group-btn" data-mobile="cart-wishlist-detail span4">
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152. </div>
  153. </div>
  154.  
  155.  
  156. </div>
  157. </div>
  158. </li>
  159. <?php endforeach; ?>
  160. </ol>
  161. <script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
  162. <?php else: ?>
  163. <?php $_collectionSize = $_productCollection->count() ?>
  164. <?php
  165. $_columnCount = 4;
  166. ?>
  167. <?php $j=0;$i=0; $k=0; foreach ($_productCollection as $_product): $j++; $k++;?>
  168. <?php
  169. $now = date("Y-m-d");
  170. $newsFrom= substr($_product->getData('news_from_date'),0,10);
  171. $newsTo= substr($_product->getData('news_to_date'),0,10);
  172. $specialprice = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialPrice();
  173.  
  174. ?>
  175. <?php if ($i++==0){ ?>
  176. <div class="products-grid">
  177. <div class="row-fluid">
  178. <?php } ?>
  179. <!--<div class="span4 <?php if($j%2==1){echo " tablet";} if($j%2==0){echo " column2";}if($j%3==0){echo " column3";}if($j%4==0){echo " column4";}?>"
  180. data-normal="span4 <?php if($j%2==1){echo " tablet";} if($j%2==0){echo " column2";}if($j%3==0){echo " column3";}if($j%4==0){echo " column4";}?>"
  181. data-tablet="span6 <?php if($j%2==1){echo " tablet";} if($j%2==0){echo " column2";}if($j%3==0){echo " column3";}if($j%4==0){echo " column4";}?>"
  182. data-stablet="span6 <?php if($j%2==1){echo " tablet";} if($j%2==0){echo " column2";}if($j%3==0){echo " column3";}if($j%4==0){echo " column4";}?>">-->
  183. <div class="span3<?php echo (($i-1)%4==0 || $i==1)?' first-normal':''; ?>" data-stablet="span6<?php echo (($i-1)%2==0 || $i==1)?' first-tablet':''; ?>" data-tablet="span6<?php echo (($i-1)%2==0 || $i==1)?' first-tablet':''; ?> <?php if($k==$_collectionSize): echo "item-last"; endif ?>">
  184. <div class="item bgcolor2">
  185. <div class="item-inner">
  186. <div class="item-box">
  187. <div class="product-image">
  188. <?php
  189. if($newsFrom != ''){
  190. if (($now>=$newsFrom && $now<=$newsTo)||($now>=$newsFrom && $newsTo =='')){
  191. //echo "<span class='newproduct-grid'>new</span>"; ?>
  192. <div class='new-item'></div>
  193. <?php }
  194. }else{
  195. if(($newsTo != "") && $newsTo >= $now){
  196. ?>
  197. <div class='new-item'></div>
  198. <?php }
  199. }
  200. if ($specialprice){
  201. //echo "<span class='saleoff-grid'>sale off</span>"; ?>
  202. <div class='sale-item'><span><?php
  203. //print_r($specialprice);
  204. //print_r($_product->getPrice());
  205. $saleof= abs(($specialprice/($_product->getPrice()))*100-100);
  206. print_r(floor($saleof));
  207. ?></span></div>
  208. <?php }
  209. ?>
  210. <a class="product-image-inner" href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" ><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->keepAspectRatio(false)->resize(273,232); ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
  211.  
  212.  
  213.  
  214. <div class="item-box-hover">
  215. <!--<div class="actions">
  216. <ul class="add-to-links">
  217. <?php if ($this->helper('wishlist')->isAllow()) : ?>
  218. <li class="wishlist-listting">
  219. <span class="icon-heart"></span>
  220. <a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?>
  221. </a>
  222. </li>
  223. <?php endif; ?>
  224. wishlist
  225. </ul>
  226. </div>-->
  227. </div>
  228. <div class="bg-hover">
  229. <div class="item-description">
  230. <?php
  231. echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description');
  232. ?>
  233. </div>
  234. <a class="fontcolor" href="<?php echo $_product->getProductUrl() ?>" title="Go to detail">
  235. <div class="go-to-detail">
  236. </div>
  237. </a>
  238. </div>
  239.  
  240. </div>
  241. </div>
  242.  
  243. <div class="item-box-footer">
  244. <h2 class="product-name">
  245. <a class="fontcolor" href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>">
  246. <?php
  247. /*if(strlen($_helper->productAttribute($_product, $_product->getName(), 'name')) > 100){
  248. echo substr($_helper->productAttribute($_product, $_product->getName(), 'name'), 0, 100) .' ...';
  249. }else{*/
  250. echo $_helper->productAttribute($_product, $_product->getName(), 'name');
  251. /*}*/
  252. ?>
  253. </a>
  254. </h2>
  255. <div class="price-wrapper">
  256. <!--span class="price-title"><?php //echo $this->__("price:"); ?></span-->
  257.  
  258. </div>
  259. <div class="ratings-wrap">
  260. <?php //if($_product->getRatingSummary()): ?>
  261. <?php echo $this->getReviewsSummaryHtml($_product, false, true); ?>
  262. <?php //endif; ?>
  263. </div>
  264. <div class="group-btn">
  265.  
  266.  
  267.  
  268.  
  269. </div>
  270. </div>
  271. </div>
  272. </div>
  273. </div>
  274. <?php if ($i==$_collectionSize){ ?>
  275. </div>
  276. </div>
  277. <?php } ?>
  278. <?php endforeach ?>
  279. <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
  280. <?php endif; ?>
  281. </div>
  282. <div class="toolbar-bottom">
  283. <?php echo $this->getToolbarHtml() ?>
  284. </div>
  285.  
  286. </div>
  287. <script type="text/javascript">
  288. $jsmart(function($){
  289. $(function () {
  290. $('#moveup-totop .moveup-toolbar').click(function() {
  291. $('body,html').animate({
  292. scrollTop: 0
  293. }, 800);
  294. return false;
  295. });
  296. });
  297. });
  298. </script>
  299. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement