Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Slide não se repete como deveria
 
rafaballack
Jr. Member
 
Total Posts:  3
Joined:  2012-07-27
 

Pessoal é o seguinte, tenho o home_slider.html que exibe imagens com botão de slide. Até aqui tudo bem, porem quando na home coloco os bloco para se repetir e mostrar categorias diferentes, fica completamente diferente do primeiro slide que exibe corretamente na horizontal. Segue uma imagem para entender melhor: http://img803.images...895/slideul.jpg

o Block é {{block type="catalog/product_list" category_id="3" template="catalog/product/home_slider.phtml"}}

Até fiz uma copia para chamar home_slider2.phtml mas sem sucesso. Aparece da mesma forma vertical. O que pode ser?

E tenho o {{block type="catalog/product_list" category_id="3" template="catalog/product/home_list.phtml"}} que está também na home. E quando a repito fica normal, tudo certinho.

Segue o home_slider.phtml

<?php
/**
* Product list template
*
* @see Mage_Catalog_Block_Product_List
*/
?>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('fancybox/jquery.fancybox-1.3.4.pack.js'); ?>"></script>
<link rel="stylesheet" href="<?php echo $this->getSkinUrl('fancybox/jquery.fancybox-1.3.4.css'); ?>” type="text/css" media="screen" />
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery(’.quick-view’).mouseover(function(e){
jQuery(this).children(’.quick-link’).show();
});

jQuery(’.quick-view’).mouseout(function(e){
jQuery(this).children(’.quick-link’).hide();
});

jQuery("a[rel=quick-link]").fancybox({
‘width’ : ‘990’,
‘height’ : ‘70%’
/*, onComplete :  function() {
product_zoom = new Product.Zoom(’image’, ‘track’, ‘handle’, ‘zoom_in’, ‘zoom_out’, ‘track_hint’);
}

‘autoScale’ : false,
‘transitionIn’ : ‘none’,
‘transitionOut’ : ‘none’,
‘type’:’iframe’*/
});

});
</script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/jquery.jcarousel.min.js');?>"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(’#carousel’).jcarousel({
wrap: ‘circular’,
scroll:1
});
});
</script>

<?php
$_productCollection=$this->getLoadedProductCollection();
$_helper = $this->helper('catalog/output');
?>
<?php if(!$_productCollection->count()): ?>

<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
<?php else: ?>
<?php // Grid Mode ?>
<?php $_collectionSize = $_productCollection->count() ?>
<?php $_columnCount = 100 //$this->getColumnCount(); ?>
<?php $i=0; foreach ($_productCollection as $_product): ?>
<?php if ($i++%$_columnCount==0): ?>
<div class="jcarousel-skin-tango">
<div class="jcarousel-container">
<div class="jcarousel-clip">
<ul id="carousel" class="products-carousel">
<?php endif ?>
<li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
<div class="border quick-view">
<?php if( Mage::getModel('newproduct/grid')->isNewProduct($_product->getId()) ): ?>
<div class="products-new">New</div>
<?php endif; ?>
<a href="<?php echo $_product->getProductUrl() ?>” title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>” class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(190,280); ?>” alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>” /></a>
<div class="quick-link"><a href="<?php echo $this->getUrl('quickview/index/index',array('id'=>$_product->getId())); ?>” rel="quick-link"></a></div>

<div class="carousel-info">
<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>
<?php echo $this->getPriceHtml($_product, true) ?>
</div>
</div>
</li>
<?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
</ul>
</div>
<div disabled="disabled" class="jcarousel-prev jcarousel-prev-disabled"> </div>
<div class="jcarousel-next"> </div>
</div>
</div>
<?php endif ?>
<?php endforeach ?>
<script type="text/javascript">decorateGeneric($$(’ul.products-grid’), [’odd’,’even’,’first’,’last’])</script>
<?php endif; ?>

E o home_list.phtml

<?php
$_productCollection=$this->getLoadedProductCollection();
$categoryID = $this->category_id;
//$categoryID = $this->getCategoryId();
if($categoryID){
$category = new Mage_Catalog_Model_Category();
$category->load($categoryID); // this is category id
$collection = $category->getProductCollection();
} else{
$collection = Mage::getResourceModel('catalog/product_collection');
}
Mage::getModel('catalog/layer')->prepareProductCollection($collection);
$collection->getSelect()->order('rand()');
$collection->addStoreFilter();
$quant_produtos = 4; //QUANTIDADE DE PRODUTOS LISTADOS
$numProducts = $this->getNumProducts() ? $this->getNumProducts() : $quant_produtos;
$collection->setPage(1, $numProducts)->load();
$_productCollection = $this->_productCollection = $collection;

?>
<?php
$_productCollection=$this->getLoadedProductCollection();
$_helper = $this->helper('catalog/output');
?>
<?php if(!$_productCollection->count()): ?>

<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
<?php else: ?>
<?php // Grid Mode ?>
<?php $_collectionSize = $_productCollection->count() ?>
<?php $_columnCount = 4 //$this->getColumnCount(); ?>
<?php $i=0; foreach ($_productCollection as $_product): ?>
<?php if ($i++%$_columnCount==0): ?>
<ul class="products-grid row">
<?php endif ?>
<li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?> span3">
<div class="products-box">
<?php if( Mage::getModel('newproduct/grid')->isNewProduct($_product->getId()) ): ?>
<div class="products-new">New</div>
<?php endif; ?>
<a href="<?php echo $_product->getProductUrl() ?>” title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>” class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(590,714); ?>” alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>” /> </a>
<?php if($_product->getRatingSummary()): ?>
<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
<?php endif; ?>
<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>
<?php /*?><div class="desc std"><?php if ($_product->getData('short_description')): ?>
<?php echo substr($_product->getResource()->getAttribute('short_description')->getFrontend()->getValue($_product),0,88), '...' ?><?php endif ?> </div><?php */?>
<div class="price-action">
<div class="actions">
<?php if($_product->isSaleable()): ?>
<button type="button" title="<?php echo $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>
<?php else: ?>
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
<?php endif; ?>
</div>
<?php echo $this->getPriceHtml($_product, true) ?> </div>
</div>
</li>
<?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
</ul>
<?php endif ?>
<?php endforeach ?>
<script type="text/javascript">decorateGeneric($$(’ul.products-grid’), [’odd’,’even’,’first’,’last’])</script>
<?php endif; ?>

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top