Responsive Best seller [chiuso]
-
13-12-2019 - |
Domanda
Ho aggiunto best seller sulla mia homepage riferimento a questo link https://blog.amasty.com/how-to-display-bestselling-products-in-magento-source-code/ ma non è reattivo, voglio renderlo reattivo in modo che i prodotti nel blocco best seller non si nascondano con la barra di scorrimento orizzontale (in basso)
Soluzione
Ho ottenuto la risposta semplicemente aggiungendo il seguente codice nel mio file css
float:left
Altri suggerimenti
È possibile utilizzare responsive carousel
http://owlgraphic.com/owlcarousel/
http://owlgraphic.com/owlcarousel/#demo
<?php $_productCollection=$this->getLoadedProductCollection();?>
<?php if ($_productCollection>count()): ?>
<div class="owl-carousel-wrapper">
<div class="owl-carousel" id="home-product-slider">
<?php foreach ($_productCollection as $_product): ?>
<div class="item">
<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(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
<?php echo $this->getPriceHtml($_product, true) ?>
</div>
<?php endforeach; ?>
</div>
</div>
<script>
jQuery(document).ready(function() {
var owl = jQuery("#home-product-slider");
owl.owlCarousel({
responsiveClass: true,
});
});
</script>
<?php endif; ?>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange