Contagem de Produtos
Tenho um código que conta os produtos relacionados de uma loja, e quanto mais produtos relacionados a um único produto, a página vai ficando mais e mais lenta.
Gostaria de ajuda para limitar a 18 produtos, segue o código:
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category design
* @package base_default
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
/**
* Shoping cart sidebar
*
* @see Mage_Checkout_Block_Cart_Sidebar
*/
$title = $this->getTitle();
$le = $this->getBoughtProducts();
$lecount=count($le );
?>
<?php if($this->getEnable()){ ?>
<div class="box-collateral box-up-sell">
<?php if($lecount>0): ?>
<div class="box-title">
<strong><span><?php echo $title; ?>
<small><?php echo $this->__('(%d)', $lecount) ?></small>
</span></strong>
</div>
<?php endif; ?>
<div class="products-grid" id="upsell-product-table2">
<div id="slideshow2" class="slideshow2">
<div class="slideshow-box">
<?php if($lecount>0): ?>
<ul style="padding-left:20px;overflow:hidden;" class="espaco-produto">
<?php foreach ($le as $_index => $_item) { ?>
<?php
if (!isset($_productNameStripped)) $_productNameStripped= '';
if (!isset($freeShippingText)) $freeShippingText= '';
?>
<li style="max-height:230px;">
<a href="<?php echo $_item->getProductUrl() ?>" class="product-image">
<img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(130); ?>" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" width="90" height="90" />
</a>
<div style="width:100%;" class="product-detail-slide" >
<p class="tituloproduto"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->htmlEscape($_item->getName()) ?></a></p>
<?php echo $this->getPriceHtml($_item) ?>
<?php if($_item->isSaleable()): ?>
<div class="clear" ></div>
<p style="float:left;margin-top:-17px;" class="learn-more"><span class="free-shipping-message"><a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>"><?php echo $freeShippingText; ?></a></span></br><a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn">Mais Detalhes</a>
</p>
<?php endif; ?>
</div>
</li>
<?php } ?>
</ul>
<?php endif; ?>
</div>
<a href="#" style="z-index:1;" class="previous">Previous</a>
<a href="#" style="z-index:9999;" class="next">Next</a>
</div>
</div>
</div>
<?php } ?>Discussão (0)
Carregando comentários...