Responsive Best seller [closed]
-
13-12-2019 - |
Question
I have added best seller on my homepage referring to this link https://blog.amasty.com/how-to-display-bestselling-products-in-magento-source-code/ but it is not responsive, I want to make it responsive so that products in best seller block doesn't hide with the horizontal scroll bar(at the bottom)
Solution
I got the answer by just adding following code in my css file
float:left
OTHER TIPS
You can use 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; ?>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange