Categories
bigcommerce Bigcommerce Cornerstone Light Theme blog Cornerstone stencil

how to fix bigcommerce cornerstone mobile new, related products carousel not showing correctly?

Replace below code with templates/components/products/carousel.html

 

 Screen Shot 2019-05-20 at 9.11.45 AMScreen Shot 2019-05-20 at 9.13.34 AM

<section class="productCarousel"
    data-list-name="{{list}}">
    {{#each products}}
    <div class="productCarousel-slide">
            {{> components/products/card settings=../settings theme_settings=../theme_settings customer=../customer event="list" position=(add @index 1)}}
    </div>
    {{/each}}
</section>
<script src="https://code.jquery.com/jquery-2.2.4.js" integrity="sha256-iT6Q9iMJYuQiMWNd9lDyBUStIq/8PuOW33aOqmvFpqI=" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/slick.min.js"></script>
<!-- Add the slick-theme.css if you want default styling --> 
<script type="text/javascript">
    $('.productCarousel').slick({
  dots: true,
  infinite: false,
  speed: 300,
  slidesToShow: 4,
  slidesToScroll: 4,
  responsive: [
    {
      breakpoint: 1024,
      settings: {
        slidesToShow: 3,
        slidesToScroll: 3,
        infinite: true,
        dots: true
      }
    },
    {
      breakpoint: 600,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2
      }
    },
    {
      breakpoint: 480,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2
      }
    }
    // You can unslick at a given breakpoint now by adding:
    // settings: "unslick"
    // instead of a settings object
  ]
});
            
</script>