Advertisement
vikasrao999

Untitled

Jun 9th, 2014
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.63 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. <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
  98. <li>
  99. <span class="icon-exchange"></span>
  100. <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a>
  101. </li>
  102. <?php endif; ?>
  103. </ul>
  104. </div>
  105. <div class="bg-hover"></div>-->
  106. </div>
  107. <div class="pl_infobox">
  108. <div class="products-list-info ">
  109. <div class="item-box-footer" data-mobile="item-box-footer span4">
  110. <div class="item-box-content">
  111. <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
  112. <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>
  113. <!--div class="stock-status">
  114. <?php //if ($_product->isAvailable()): ?>
  115. <?php //echo $this->__('Availability:') ?><p class="availability in-stock">
  116. <span><?php //echo $this->__('In stock') ?></span></p>
  117. <?php //else: ?>
  118. <?php //echo $this->__('Availability:') ?><p class="availability out-of-stock">
  119. <span><?php //echo $this->__('Out of stock') ?></span></p>
  120. <?php //endif; ?>
  121. </div-->
  122. <div class="ratings-wrap">
  123. <?php //if($_product->getRatingSummary()): ?>
  124. <?php echo $this->getReviewsSummaryHtml($_product, false, true); ?>
  125. <?php //endif; ?>
  126. </div>
  127.  
  128.  
  129. </div>
  130. </div>
  131. <!--<div class="span8" data-tablet="span12" data-normal="span12">-->
  132. <div class="box-main" data-mobile="box-main span4">
  133. <div class="box-price-review">
  134. <div class="price-wrapper">
  135. <!--span class="price-title"><?php //echo $this->__("price:"); ?></span-->
  136. <?php echo $this->getPriceHtml($_product, true) ?>
  137. </div>
  138. <?php //echo $this->getReviewsSummaryHtml($_product, false, false)?>
  139. </div>
  140. <div class="desc std">
  141. <?php
  142. echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description');
  143. ?>
  144. <!-- a class="readmore" href="<?php //echo $_product->getProductUrl(); ?>">More detail</a-->
  145. </div>
  146. </div>
  147. <!--</div>-->
  148.  
  149. <div class="group-btn" data-mobile="cart-wishlist-detail span4">
  150.  
  151. <a title="<?php echo $this->__('Add to Cart') ?>" href="javascript:void(0);" class="btn-cart bgcolor fontcolor" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')">
  152. <span class="icon-cart"></span>
  153. <span class="icon-cart-text">Add To Cart</span>
  154. </a>
  155.  
  156.  
  157. <a title="<?php echo $this->__('Add to wishlist') ?>" class="btn-wishlist" href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>">
  158. <span class="icon-wishlist"></span>
  159. <span class="icon-wishlist-text">Add To Wishlist</span>
  160. </a>
  161. <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
  162. <a href="<?php echo $_compareUrl ?>" class="btn-compare" title="<?php echo $this->__('Add to compare') ?>">
  163. <span class="icon-compare"></span>
  164. <span class="compare-text"><?php echo $this->__('Add to Compare') ?></span>
  165. </a>
  166. <?php endif; ?>
  167.  
  168. </div>
  169. </div>
  170.  
  171.  
  172. </div>
  173. </div>
  174. </li>
  175. <?php endforeach; ?>
  176. </ol>
  177. <script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
  178. <?php else: ?>
  179. <?php $_collectionSize = $_productCollection->count() ?>
  180. <?php
  181. $_columnCount = 4;
  182. ?>
  183. <?php $j=0;$i=0; $k=0; foreach ($_productCollection as $_product): $j++; $k++;?>
  184. <?php
  185. $now = date("Y-m-d");
  186. $newsFrom= substr($_product->getData('news_from_date'),0,10);
  187. $newsTo= substr($_product->getData('news_to_date'),0,10);
  188. $specialprice = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialPrice();
  189.  
  190. ?>
  191. <?php if ($i++==0){ ?>
  192. <div class="products-grid">
  193. <div class="row-fluid">
  194. <?php } ?>
  195. <!--<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";}?>"
  196. 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";}?>"
  197. 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";}?>"
  198. 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";}?>">-->
  199. <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 ?>">
  200. <div class="item bgcolor2">
  201. <div class="item-inner">
  202. <div class="item-box">
  203. <div class="product-image">
  204. <?php
  205. if($newsFrom != ''){
  206. if (($now>=$newsFrom && $now<=$newsTo)||($now>=$newsFrom && $newsTo =='')){
  207. //echo "<span class='newproduct-grid'>new</span>"; ?>
  208. <div class='new-item'></div>
  209. <?php }
  210. }else{
  211. if(($newsTo != "") && $newsTo >= $now){
  212. ?>
  213. <div class='new-item'></div>
  214. <?php }
  215. }
  216. if ($specialprice){
  217. //echo "<span class='saleoff-grid'>sale off</span>"; ?>
  218. <div class='sale-item'><span><?php
  219. //print_r($specialprice);
  220. //print_r($_product->getPrice());
  221. $saleof= abs(($specialprice/($_product->getPrice()))*100-100);
  222. print_r(floor($saleof));
  223. ?></span></div>
  224. <?php }
  225. ?>
  226. <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>
  227.  
  228.  
  229.  
  230. <div class="item-box-hover">
  231. <!--<div class="actions">
  232. <ul class="add-to-links">
  233. <?php if ($this->helper('wishlist')->isAllow()) : ?>
  234. <li class="wishlist-listting">
  235. <span class="icon-heart"></span>
  236. <a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?>
  237. </a>
  238. </li>
  239. <?php endif; ?>
  240. <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
  241. <li class="compare-listting">
  242. <span class="icon-exchange"></span>
  243. <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a>
  244. </li>
  245. <?php endif; ?>
  246. </ul>
  247. </div>-->
  248. </div>
  249. <div class="bg-hover">
  250. <div class="item-description">
  251. <?php
  252. echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description');
  253. ?>
  254. </div>
  255. <a class="fontcolor" href="<?php echo $_product->getProductUrl() ?>" title="Go to detail">
  256. <div class="go-to-detail">
  257. </div>
  258. </a>
  259. </div>
  260.  
  261. </div>
  262. </div>
  263.  
  264. <div class="item-box-footer">
  265. <h2 class="product-name">
  266. <a class="fontcolor" href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>">
  267. <?php
  268. /*if(strlen($_helper->productAttribute($_product, $_product->getName(), 'name')) > 100){
  269. echo substr($_helper->productAttribute($_product, $_product->getName(), 'name'), 0, 100) .' ...';
  270. }else{*/
  271. echo $_helper->productAttribute($_product, $_product->getName(), 'name');
  272. /*}*/
  273. ?>
  274. </a>
  275. </h2>
  276. <div class="price-wrapper">
  277. <!--span class="price-title"><?php //echo $this->__("price:"); ?></span-->
  278. <?php echo $this->getPriceHtml($_product, true) ?>
  279. </div>
  280. <div class="ratings-wrap">
  281. <?php //if($_product->getRatingSummary()): ?>
  282. <?php echo $this->getReviewsSummaryHtml($_product, false, true); ?>
  283. <?php //endif; ?>
  284. </div>
  285. <div class="group-btn">
  286. <a title="<?php echo $this->__('Add to Cart') ?>" href="javascript:void(0);" class="btn-cart bgcolor fontcolor" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')">
  287. <span class="icon-cart"></span>
  288. <span class="icon-cart-text">Add To Cart</span>
  289. </a>
  290. <a title="<?php echo $this->__('Add to wishlist') ?>" class="btn-wishlist" href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>">
  291. <span class="icon-wishlist"></span>
  292. <span class="icon-wishlist-text">Add To Wishlist</span>
  293. </a>
  294. <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
  295. <a class="btn-compare" href="<?php echo $_compareUrl ?>" title="<?php echo $this->__('Add to compare') ?>">
  296. <span class="icon-compare"></span>
  297. <span class="compare-text">
  298. <?php echo $this->__('Add to Compare') ?>
  299. </span>
  300. </a>
  301.  
  302. <?php endif; ?>
  303. </div>
  304. </div>
  305. </div>
  306. </div>
  307. </div>
  308. <?php if ($i==$_collectionSize){ ?>
  309. </div>
  310. </div>
  311. <?php } ?>
  312. <?php endforeach ?>
  313. <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
  314. <?php endif; ?>
  315. </div>
  316. <div class="toolbar-bottom">
  317. <?php echo $this->getToolbarHtml() ?>
  318. </div>
  319.  
  320. </div>
  321. <script type="text/javascript">
  322. $jsmart(function($){
  323. $(function () {
  324. $('#moveup-totop .moveup-toolbar').click(function() {
  325. $('body,html').animate({
  326. scrollTop: 0
  327. }, 800);
  328. return false;
  329. });
  330. });
  331. });
  332. </script>
  333. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement