문제

이 링크를 언급하는 홈페이지에 베스트셀러를 추가했습니다. https://blog.amasty.com/how-to-display-best판매-products-in-magento-source-code/반응형이 아닌데, 베스트 셀러 블록에 있는 제품이 가로 스크롤바(하단)로 숨기지 않도록 반응형으로 만들고 싶습니다.enter image description here

도움이 되었습니까?

해결책

내 CSS 파일에 다음 코드를 추가하여 답을 얻었습니다.

float:left

다른 팁

반응형 캐러셀을 사용할 수 있습니다.

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; ?>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top