Bagisto Forum

    Bagisto

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

    Number of new & featured products in bagisto

    Knowledge Base
    2
    2
    694
    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.
    • M
      mtande last edited by

      I have uploaded many products in my bagisto store but in front end,it shows only four products in featured products and four in as new products

      How can i display all featured products and all new products instead of only four products
      bag.PNG

      1 Reply Last reply Reply Quote 0
      • P
        prateek-webkul last edited by

        Hi mtande,

        • You need to override the (Webkul\Product\Repositories\ProductRepository) in your package and pass an parameters to getNewProducts and getFeaturedProducts methods in your package repository.

        • And, to get dynamic parameters, you need to create configuration in admin panel for 'Number of products you want to display at shop from configuration to get no of product you want to display at shop.

        • Also, you need to override the featured-products and new-products blade file in (Shop/resources/view/home) and perform an check as below code

        @php
            $count = 4;
            $config = core()->getConfigData('acme.configuration.general.featured_product');
        
            if ($config > 4)
                $count = $config;
        
            $featuredProducts = app('Webkul\Acme\Repositories\Product\ProductRepository')->getFeaturedProducts($count);
        
            $featuredProductsCount = $featuredProducts->count();
          
        @endphp
        

        Thanks

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