سؤال

لقد أضفت أفضل بائع على صفحتي الرئيسية في إشارة إلى هذا الرابط https://blog.amasty.com/how-to-display-bestsseling-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