Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    The New Carousel for categories image & name not working ???

    Bug Report
    2
    2
    942
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dailamy1983 last edited by

      i try to add bootstrap carousel in homepage for categories but it is not working why???
      this my code:
      @php
      $categories = [];

      foreach (app('Webkul\Category\Repositories\CategoryRepository')->getVisibleCategoryTree(core()->getCurrentChannel()->root_category_id) as $category) {
          if ($category->slug)
          array_push($categories, $category);
      }
      

      @endphp

          <div id="demo2x" class="carousel slide" data-ride="carousel">
      
              <!-- Indicators -->
              <ul class="carousel-indicators">
                <li data-target="#demo2x" data-slide-to="0" class="active"></li>
                <li data-target="#demo2x" data-slide-to="1"></li>
                <li data-target="#demo2x" data-slide-to="2"></li>
              </ul>
      
              <!-- The slideshow -->
              <div class="carousel-inner">
                  @foreach($categories as $category_data)
                  <div class="carousel-item">
                      <img src="{{ asset('/storage/' . $category_data->image) }}" >
                    </div>
              @endforeach
      
      
              </div>
      
              <!-- Left and right controls -->
              <a class="carousel-control-prev" href="#demo2x" data-slide="prev">
                <span class="carousel-control-prev-icon"></span>
              </a>
              <a class="carousel-control-next" href="#demo2x" data-slide="next">
                <span class="carousel-control-next-icon"></span>
              </a>
      
            </div>
      
      1 Reply Last reply Reply Quote 0
      • devansh-webkul
        devansh-webkul last edited by

        What error are you getting?

        1 Reply Last reply Reply Quote 0
        • First post
          Last post