Guest User

Untitled

a guest
Jun 25th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.24 KB | None | 0 0
  1. <?php
  2. class Mage_Catalog_Block_Product_Special extends Mage_Catalog_Block_Product_List {
  3. function get_prod_count() {
  4.  
  5. Mage::getSingleton('catalog/session')->unsLimitPage();
  6. return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 300;
  7. }
  8.  
  9. function get_cur_page() {
  10. return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
  11. }
  12.  
  13. protected function _getProductCollection() {
  14. $todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
  15. $tomorrow = mktime(0, 0, 0, date('m'), date('d')+1, date('y'));
  16. $dateTomorrow = date('m/d/y', $tomorrow);
  17.  
  18. $collection = Mage::getResourceModel('catalog/product_collection');
  19. $collection->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds());
  20.  
  21. $collection = $this->_addProductAttributesAndPrices($collection)
  22. ->addStoreFilter()
  23. ->addAttributeToSort('entity_id', 'desc')
  24. ->addAttributeToFilter('special_from_date', array('date' => true, 'to' => $todayDate))
  25. ->addAttributeToFilter('special_to_date', array('or'=> array(0 => array('date' => true, 'from' => $dateTomorrow), 1 => array('is' => new Zend_Db_Expr('null')))), 'left')
  26. ->setPageSize($this->get_prod_count())
  27. ->setCurPage($this->get_cur_page());
  28.  
  29. $this->setProductCollection($collection);
  30. return $collection;
  31. }
  32. }
  33. ?>
  34.  
  35. <?php
  36. $columnsCount = 3;
  37. if (($_products = $this->getProductCollection()) && $_products->getSize()):
  38. ?>
  39.  
  40. <div class="category-products">
  41. <ol class="products-grid" style="list-style: none;">
  42. <?php $i = 0; foreach ($_products->getItems() as $_product): ?>
  43. <?php // if($i++%$columnsCount == 0) : ?><?php // endif; ?>
  44. <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
  45. <?php // Product Image ?>
  46. <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
  47. <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(300, 200); ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
  48. </a>
  49.  
  50. <div class="product-shop">
  51. <div class="f-fix">
  52. <?php // Product Title ?>
  53. <h2 class="the-product-manufacturer-grid"><a href=""><?php echo $_product->getAttributeText('manufacturer') ?></a><span class="the-product-name-grid"> / <a class="product-name" href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>)"><?php echo $this->htmlEscape($_product->getName()) ?></a></span></h2>
  54.  
  55. <?php // Product Price ?>
  56. <div class="listpricebox"><?php echo $this->getPriceHtml($_product, true, $this->getPriceSuffix()) ?></div>
  57. </div>
  58. </div>
  59. </li>
  60. <?php // if($i%$columnsCount == 0 || $i == count($_products)): ?><?php // endif; ?>
  61. <?php endforeach; ?>
  62. </ol>
  63. </div>
  64.  
  65. <script type="text/javascript">decorateGeneric($$('.grid-row'), ['first', 'last', 'odd', 'even']);</script>
  66. <?php endif; ?>
  67.  
  68. {{block type="catalog/product_special" template="catalog/product/special.phtml"}}
  69.  
  70. <?php
  71. class Mage_Catalog_Block_Product_Special extends Mage_Catalog_Block_Product_List {
  72.  
  73. protected function _getProductCollection() {
  74. // we need the date to filter for the special price
  75. $dateToday = date('m/d/y');
  76. $tomorrow = mktime(0, 0, 0, date('m'), date('d')+1, date('y'));
  77. $dateTomorrow = date('m/d/y', $tomorrow);
  78.  
  79. // this gets the product collection and filters for special price;
  80. // grabs products with special_from_date at least today, and special_to_date at least tomorrow
  81. $_productCollection = Mage::getModel('catalog/product')->getCollection()
  82. ->addAttributeToFilter('special_from_date', array('date' => true, 'to' => $dateToday))
  83. ->addAttributeToFilter('special_to_date', array('date' => true, 'from' => $dateTomorrow))
  84. ->load();
  85.  
  86. // this loads the standard magento catalog proce rule model
  87. $rules = Mage::getResourceModel('catalogrule/rule_collection')->load();
  88.  
  89. // read: if there are active rules
  90. if($rules->getData()) {
  91. $rule_ids = array(); // i used this down below to style the products according to which rule affected
  92. $productIds[] = array(); // this will hold the ids of the products
  93.  
  94. foreach($rules as $rule) {
  95. $rule_ids[] = $rule->getId();
  96. $productIds = $rule->getMatchingProductIds(); // affected products come in here
  97. }
  98.  
  99. // merge the collections: $arr is an array and keeps all product IDs we fetched before with the special-price-stuff
  100. $arr = $_productCollection->getAllIds();
  101. if($productIds) {
  102. // if there are products affected by catalog price rules, $arr now also keeps their IDs
  103. $arr = array_merge($arr,$productIds);
  104. }
  105.  
  106. // we initialize a new collection and filter solely by the product IDs we got before, read: select all products with their entity_id in $arr
  107. $_productCollection = Mage::getModel('catalog/product')->getCollection()
  108. ->addAttributeToFilter('entity_id',array('in'=>$arr))
  109. ->load();
  110. }
  111. }
  112. }
  113.  
  114. <?php
  115. // we need the date to filter for the special price
  116. $dateToday = date('m/d/y');
  117. $tomorrow = mktime(0, 0, 0, date('m'), date('d')+1, date('y'));
  118. $dateTomorrow = date('m/d/y', $tomorrow);
  119.  
  120. // this gets the product collection and filters for special price;
  121. // grabs products with special_from_date at least today, and special_to_date at least tomorrow
  122. $_productCollection = Mage::getModel('catalog/product')->getCollection()
  123. ->addAttributeToFilter('special_from_date', array('date' => true, 'to' => $dateToday))
  124. ->addAttributeToFilter('special_to_date', array('date' => true, 'from' => $dateTomorrow))
  125. ->load();
  126.  
  127. // this loads the standard magento catalog proce rule model
  128. $rules = Mage::getResourceModel('catalogrule/rule_collection')->load();
  129.  
  130. // read: if there are active rules
  131. if($rules->getData()) {
  132. $rule_ids = array(); // i used this down below to style the products according to which rule affected
  133. $productIds[] = array(); // this will hold the ids of the products
  134.  
  135. foreach($rules as $rule) {
  136. $rule_ids[] = $rule->getId();
  137. $productIds = $rule->getMatchingProductIds(); // affected products come in here
  138. }
  139.  
  140. // merge the collections: $arr is an array and keeps all product IDs we fetched before with the special-price-stuff
  141. $arr = $_productCollection->getAllIds();
  142. if($productIds) {
  143. // if there are products affected by catalog price rules, $arr now also keeps their IDs
  144. $arr = array_merge($arr,$productIds);
  145. }
  146.  
  147. // we initialize a new collection and filter solely by the product IDs we got before, read: select all products with their entity_id in $arr
  148. $_productCollection = Mage::getModel('catalog/product')->getCollection()
  149. ->addAttributeToFilter('entity_id',array('in'=>$arr))
  150. ->load();
  151. }
  152.  
  153. <?php
  154.  
  155. $_helper = $this->helper('catalog/output');
  156. $_collectionSize = $_productCollection->count();
  157.  
  158. <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
  159. <?php if (Mage::helper('themeframework/settings')->getProductsList_ShowLabel()):?>
  160. <!--show label product - label extension is required-->
  161. <?php Mage::helper('productlabels')->display($_product);?>
  162. <?php endif ?>
  163. <?php if($altImgList):?>
  164. <img class="em-img-lazy img-responsive em-alt-hover" src="<?php echo $this->getSkinUrl('images/loading.gif') ?>" data-original="<?php echo $this->helper('catalog/image')->init($_product, $altImgList)->resize($_wImgList, $_hImgList); ?>" width="<?php echo $_wImgList ?>" height="<?php echo $_hImgList ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, $altImgList), null, true) ?>" />
  165. <?php endif;?>
  166. <img id="product-collection-image-<?php echo $_product->getId(); ?>" class="em-img-lazy img-responsive <?php if ($altImgList): ?>em-alt-org<?php endif ?>" src="<?php echo $this->getSkinUrl('images/loading.gif') ?>" data-original="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($_wImgList, $_hImgList); ?>" width="<?php echo $_wImgList ?>" height="<?php echo $_hImgList ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
  167. </a>
  168. <?php else:?>
  169. <?php if (Mage::helper('themeframework/settings')->getProductsList_ShowLabel()):?>
  170. <!--show label product - label extension is required-->
  171. <?php Mage::helper('productlabels')->display($_product);?></a>
  172. <?php endif ?>
  173. <?php endif
  174. // Product description ?>
  175. <div class="product-shop">
  176. <div class="f-fix">
  177. <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
  178. <!--product name-->
  179. <?php if (Mage::helper('themeframework/settings')->getProductsList_ShowProductName()):?>
  180. <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>">
  181. <?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?>
  182. </a></h2>
  183. <?php
  184. if ($this->getChild('name.after')) {
  185. $_nameAfterChildren = $this->getChild('name.after')->getSortedChildren();
  186. foreach ($_nameAfterChildren as $_nameAfterChildName) {
  187. $_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
  188. $_nameAfterChild->setProduct($_product);
  189. echo $_nameAfterChild->toHtml();
  190. }
  191. } endif ?>
  192.  
  193. <!--product description-->
  194. <?php if (Mage::helper('themeframework/settings')->getProductsList_ShowDesc()): ?>
  195. <div class="desc std">
  196. <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
  197. <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
  198. </div>
  199. <?php endif ?>
  200. <!--show reviews-->
  201. <?php if (Mage::helper('themeframework/settings')->getProductsList_ShowReviews()):?>
  202. <?php if($_product->getRatingSummary()): ?>
  203. <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
  204. <?php endif; ?>
  205. <?php endif
  206. if (Mage::helper('themeframework/settings')->getProductsList_ShowPrice()): ?>
  207. <?php echo $this->getPriceHtml($_product, true) ?>
  208. <?php endif ?>
  209.  
  210. <div class="actions">
  211. <?php if($_product->isSaleable()): ?>
  212. <?php if (Mage::helper('themeframework/settings')->getProductsList_ShowAddtocart()): ?>
  213. <button type="button" title="<?php echo Mage::helper('core')->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>
  214. <?php endif ?>
  215. <?php else: ?>
  216. <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
  217. <?php endif; ?>
  218. <?php if (Mage::helper('themeframework/settings')->getProductsList_ShowAddto()): ?>
  219. <ul class="add-to-links">
  220. <?php if ($this->helper('wishlist')->isAllow()) : ?>
  221. <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>
  222. <?php endif; ?>
  223. <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
  224. <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>
  225. <?php endif; ?>
  226. </ul>
  227. <?php endif ?>
  228. </div>
  229. </div>
  230. </div>
  231. </li>
  232. <?php endforeach; ?>
  233. </ol>
  234. <script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
  235.  
  236. <?php else: ?>
  237.  
  238. <?php // Grid Mode ?>
  239. <?php
  240. // set column count
  241. $_pageLayout = substr((str_replace(array('page/','.phtml'),'',Mage::app()->getLayout()->getBlock('root')->getTemplate())),0,1);
  242.  
  243. // Grid Mode
  244. $_wImgGrid = 280;
  245. $_hImgGrid = 280;
  246. if(Mage::helper('themeframework/settings')->getProductsGrid_ImageRatio()!=0){
  247. $_ratioImgGrid = Mage::helper('themeframework/settings')->getProductsGrid_ImageRatio();
  248. if(Mage::helper('themeframework/settings')->getGeneral_DisableResponsive(1)!=0){
  249. switch(Mage::helper('themeframework/settings')->checkDevice()){
  250. case 'desktop':
  251. switch($_pageLayout){
  252. case 3:
  253. $_columnCount = Mage::helper('themeframework/settings')->getProductsGrid_Threecolumns(3);
  254. break;
  255. case 1:
  256. $_columnCount = Mage::helper('themeframework/settings')->getProductsGrid_Onecolumn(5);
  257. break;
  258. default:
  259. $_columnCount = Mage::helper('themeframework/settings')->getProductsGrid_Twocolumns(4);
  260. break;
  261. }
  262. $_winWidth = 1200;
  263. break;
  264. case 'tablet':
  265. switch($_pageLayout){
  266. case 3:
  267. $_columnCount = Mage::helper('themeframework/settings')->getProductsGrid_TabletThreecolumns(3);
  268. break;
  269. case 1:
  270. $_columnCount = Mage::helper('themeframework/settings')->getProductsGrid_TabletOnecolumn(5);
  271. break;
  272. default:
  273. $_columnCount = Mage::helper('themeframework/settings')->getProductsGrid_TabletTwocolumns(4);
  274. break;
  275. }
  276. $_winWidth = 1024;
  277. break;
  278. case 'mobile':
  279. $_columnCount = Mage::helper('themeframework/settings')->getProductsGrid_ItemsMobile(3);
  280. $_winWidth = 320;
  281. break;
  282. }
  283. }else{
  284. switch($_pageLayout){
  285. case 3:
  286. $_columnCount = Mage::helper('themeframework/settings')->getProductsGrid_Threecolumns(3);
  287. break;
  288. case 1:
  289. $_columnCount = Mage::helper('themeframework/settings')->getProductsGrid_Onecolumn(5);
  290. break;
  291. default:
  292. $_columnCount = Mage::helper('themeframework/settings')->getProductsGrid_Twocolumns(4);
  293. break;
  294. }
  295. $_winWidth = 1200;
  296. }
  297. switch($_pageLayout){
  298. case 3:
  299. $_columnsContent = 12;
  300. break;
  301. case 1:
  302. $_columnsContent = 24;
  303. break;
  304. default:
  305. $_columnsContent = 18;
  306. break;
  307. }
  308. $_wImgGrid = (($_columnsContent/24) * $_winWidth)/$_columnCount - 20;
  309. if($_ratioImgGrid==-1){
  310. $_hImgGrid = ($_wImgGrid*Mage::helper('themeframework/settings')->getProductsGrid_CustomHeight())/Mage::helper('themeframework/settings')->getProductsGrid_CustomWidth();
  311. }else{
  312. $_hImgGrid = ($_wImgGrid/$_ratioImgGrid);
  313. }
  314. }
  315.  
  316. $altImgGrid = Mage::helper('themeframework/settings')->getProductsGrid_AltImg();
  317.  
  318. // Hover Effect
  319. switch(Mage::helper('themeframework/settings')->getProductsGrid_ConfigHover()){
  320. case 'enable':
  321. $_classHoverEffect = 'emcatalog-enable-hover';
  322. break;
  323. case 'medium_desktop':
  324. $_classHoverEffect = 'emcatalog-disable-hover-below-desktop';
  325. break;
  326. case 'tablet':
  327. $_classHoverEffect = 'emcatalog-disable-hover-below-tablet';
  328. break;
  329. case 'mobile':
  330. $_classHoverEffect = 'emcatalog-disable-hover-below-mobile';
  331. break;
  332. default:
  333. $_classHoverEffect= '';
  334. break;
  335. }
  336.  
  337. // Element Align Center
  338. switch(Mage::helper('themeframework/settings')->getProductsGrid_AlignCenter()){
  339. case 0:
  340. $_classAlignCenter = '';
  341. break;
  342. default:
  343. $_classAlignCenter= 'text-center';
  344. break;
  345. }
  346.  
  347. // Product Name Single Line
  348. switch(Mage::helper('themeframework/settings')->getProductsGrid_AutoProductName()){
  349. case 0:
  350. $_classNameSingleLine = '';
  351. break;
  352. default:
  353. $_classNameSingleLine= 'em-productname-single-line';
  354. break;
  355. }
  356. ?>
  357. <?php if ($_collectionSize > 0): ?>
  358. <div id="em-grid-mode">
  359. <ul class="emcatalog-grid-mode products-grid <?php echo $_classHoverEffect ?>">
  360. <?php $i=0; foreach ($_productCollection as $_product): ?>
  361. <li class="item<?php echo $i == 0 ?' first':''; ?><?php echo $i+1 == $_collectionSize ?' last':''; ?>">
  362. <div class="product-item">
  363. <div class="product-shop-top">
  364. <!-- Show Thumbnail -->
  365. <?php if (Mage::helper('themeframework/settings')->getProductsGrid_ShowThumbnail()): ?>
  366. <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
  367. <?php if (Mage::helper('themeframework/settings')->getProductsGrid_ShowLabel()):?>
  368. <!--show label product - label extension is required-->
  369. <?php Mage::helper('productlabels')->display($_product);?>
  370. <?php endif;?>
  371.  
  372. <?php if($altImgGrid):?>
  373. <img class="em-img-lazy img-responsive em-alt-hover" src="<?php echo $this->getSkinUrl('images/loading.gif') ?>" data-original="<?php echo $this->helper('catalog/image')->init($_product, $altImgGrid)->resize($_wImgGrid, $_hImgGrid); ?>" width="<?php echo $_wImgGrid ?>" height="<?php echo $_hImgGrid ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, $altImgGrid), null, true) ?>" />
  374. <?php endif;?>
  375. <img id="product-collection-image-<?php echo $_product->getId(); ?>" class="em-img-lazy img-responsive <?php if ($altImgGrid): ?>em-alt-org<?php endif ?>" src="<?php echo $this->getSkinUrl('images/loading.gif') ?>" data-original="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($_wImgGrid, $_hImgGrid); ?>" width="<?php echo $_wImgGrid ?>" height="<?php echo $_hImgGrid ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /><span class="bkg-hover"></span>
  376. </a>
  377. <?php else:?>
  378. <?php if (Mage::helper('themeframework/settings')->getProductsGrid_ShowLabel()):?>
  379. <!--show label product - label extension is required-->
  380. <?php Mage::helper('productlabels')->display($_product);?>
  381. <?php endif;?>
  382. <?php endif; ?>
  383.  
  384. <div class="bottom">
  385. <?php if (Mage::helper('themeframework/settings')->getProductsGrid_ShowAddtocart()): ?>
  386. <div class="em-btn-addto <?php echo $_classAlignCenter ?> <?php if (Mage::helper('themeframework/settings')->getProductsGrid_ShowAddtocart()==2): ?>em-element-display-hover<?php endif;?>">
  387. <?php if($_product->isSaleable()): ?>
  388. <!--show button add to cart-->
  389. <button type="button" title="<?php echo Mage::helper('core')->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>
  390. <?php else: ?>
  391. <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
  392. <?php endif; ?>
  393.  
  394. <!--show button add to compare-wishlist-->
  395. <ul class="add-to-links">
  396. <?php if ($this->helper('wishlist')->isAllow()) : ?>
  397. <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>
  398. <?php endif; ?>
  399. <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
  400. <li><a href="<?php echo $_compareUrl ?>" class="link-compare" title="<?php echo $this->__('Add to Compare') ?>"><?php echo $this->__('Add to Compare') ?></a></li>
  401. <?php endif; ?>
  402. </ul>
  403. </div>
  404. <?php endif;?>
  405. <?php if(Mage::helper('core')->isModuleEnabled('EM_Quickshop') && Mage::helper('quickshop')->getConfig('enable')): ?>
  406. <div class="quickshop-link-container hidden-xs">
  407. <a href="<?php echo Mage::helper('quickshop/links')->addQuickShopLink($_product->getProductUrl()); ?>" class="quickshop-link" title="<?php echo $this->__('Quickshop') ?>"><?php echo $this->__('Quickshop') ?></a>
  408. </div>
  409. <?php endif;?>
  410. </div>
  411. </div>
  412.  
  413. <div class="product-shop">
  414. <div class="f-fix">
  415. <!--product name-->
  416. <?php if (Mage::helper('themeframework/settings')->getProductsGrid_ShowProductName()):?>
  417. <h2 class="product-name <?php echo $_classAlignCenter ?> <?php echo $_classNameSingleLine ?> <?php if (Mage::helper('themeframework/settings')->getProductsGrid_ShowProductName() == 2):?>em-element-display-hover<?php endif;?>"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>">
  418. <?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>
  419. </a></h2>
  420. <?php
  421. // Provides extra blocks on which to hang some features for products in the list
  422. // Features providing UI elements targeting this block will display directly below the product name
  423. if ($this->getChild('name.after')) {
  424. $_nameAfterChildren = $this->getChild('name.after')->getSortedChildren();
  425. foreach ($_nameAfterChildren as $_nameAfterChildName) {
  426. $_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
  427. $_nameAfterChild->setProduct($_product);
  428. echo $_nameAfterChild->toHtml();
  429. }
  430. }
  431. ?>
  432. <?php endif; ?>
  433.  
  434. <!--show reviews-->
  435. <?php if (Mage::helper('themeframework/settings')->getProductsGrid_ShowReviews()):?>
  436. <div class="<?php if(Mage::helper('themeframework/settings')->getProductsGrid_ShowReviews() == 2):?>em-element-display-hover<?php endif;?> <?php echo $_classAlignCenter ?>"><?php echo $this->getReviewsSummaryHtml($_product, 'short') ?></div>
  437. <?php endif; ?>
  438.  
  439. <!--product price-->
  440. <?php if (Mage::helper('themeframework/settings')->getProductsGrid_ShowPrice()): ?>
  441. <div class="<?php echo $_classAlignCenter ?> <?php if(Mage::helper('themeframework/settings')->getProductsGrid_ShowPrice() == 2): ?>em-element-display-hover<?php endif;?>"><?php echo $this->getPriceHtml($_product, true) ?></div>
  442. <?php endif; ?>
  443.  
  444. <!--product description-->
  445. <?php if (Mage::helper('themeframework/settings')->getProductsGrid_ShowDesc()): ?>
  446. <div class="desc std <?php echo $_classAlignCenter ?> <?php if(Mage::helper('themeframework/settings')->getProductsGrid_ShowDesc() == 2):?>em-element-display-hover<?php endif;?>">
  447. <?php
  448. $shortdes = $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description');
  449. if(strlen($shortdes)>100) { //dem ki tu chuoi $str, 80 la chieu dai muon quy dinh
  450. $strCutTitle = substr($shortdes, 0, 57); //cat 80 ki tu dau
  451. $shortdes = substr($strCutTitle, 0, strrpos($strCutTitle, ' '));
  452. $shortdes = substr_replace($shortdes ,"...",-3);
  453. }
  454. echo $this->stripTags($shortdes,null,true);
  455. ?>
  456. </div>
  457. <?php endif; ?>
  458. </div>
  459. </div>
  460. </div>
  461. </li>
  462. <?php $i++;?>
  463. <?php if($i >= $_collectionSize) break;?>
  464. <?php endforeach; ?>
  465. </ul>
  466. </div>
  467. <?php endif; ?>
  468. <?php
  469. if(Mage::helper('themeframework/settings')->getGeneral_DisableResponsive(1)!=0){
  470. switch($_pageLayout){
  471. case 3:
  472. $_columnCountDesktop = Mage::helper('themeframework/settings')->getProductsGrid_Threecolumns(3);
  473. $_columnCountDesktopSmall = Mage::helper('themeframework/settings')->getProductsGrid_DesktopSmallThreecolumns(3);
  474. $_columnCountTablet = Mage::helper('themeframework/settings')->getProductsGrid_TabletThreecolumns(3);
  475. break;
  476. case 1:
  477. $_columnCountDesktop = Mage::helper('themeframework/settings')->getProductsGrid_Onecolumn(5);
  478. $_columnCountDesktopSmall = Mage::helper('themeframework/settings')->getProductsGrid_DesktopSmallOnecolumn(5);
  479. $_columnCountTablet = Mage::helper('themeframework/settings')->getProductsGrid_TabletOnecolumn(5);
  480. break;
  481. default:
  482. $_columnCountDesktop = Mage::helper('themeframework/settings')->getProductsGrid_Twocolumns(4);
  483. $_columnCountDesktopSmall = Mage::helper('themeframework/settings')->getProductsGrid_DesktopSmallTwocolumns(4);
  484. $_columnCountTablet = Mage::helper('themeframework/settings')->getProductsGrid_TabletTwocolumns(4);
  485. break;
  486. }
  487. $_columnCountMobile = Mage::helper('themeframework/settings')->getProductsGrid_ItemsMobile(3);
  488. }else{
  489. switch($_pageLayout){
  490. case 3:
  491. $_columnCountDesktop = Mage::helper('themeframework/settings')->getProductsGrid_Threecolumns(3);
  492. break;
  493. case 1:
  494. $_columnCountDesktop = Mage::helper('themeframework/settings')->getProductsGrid_Onecolumn(5);
  495. break;
  496. default:
  497. $_columnCountDesktop = Mage::helper('themeframework/settings')->getProductsGrid_Twocolumns(4);
  498. break;
  499. }
  500. }
  501.  
  502. <div class="toolbar-bottom em-box-03">
  503. <?php echo $this->getToolbarHtml() ?>
  504. </div>
  505. </div>
Add Comment
Please, Sign In to add comment