Best-seller réactif [fermé]
-
13-12-2019 - |
Question
J'ai ajouté le meilleur vendeur sur ma page d'accueil en faisant référence à ce lien https://blog.amasty.com/how-to-display-bestseller-products-in-magento-source-code/mais il n'est pas réactif, je veux le rendre réactif afin que les produits du bloc best-seller ne se cachent pas avec la barre de défilement horizontale (en bas)
La solution
J'ai obtenu la réponse en ajoutant simplement le code suivant dans mon fichier CSS
float:left
Autres conseils
Vous pouvez utiliser un carrousel réactif
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; ?>
Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange