• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

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

How to query products?

Knowledge Base
2
6
308
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
    miguel.barbosa last edited by 29 Nov 2024, 12:04

    I want to get all my products that have a specific attribute with a specific value.

    I want to know how to query products in general through code. Can someone help me out with this?

    1 Reply Last reply Reply Quote 0
    • Rishabh-Webkul
      Rishabh-Webkul last edited by 2 Dec 2024, 04:25

      Hello @miguel-barbosa

      Override the getAll method and pass your new custom parameters to use it.

      Thanks & Regards

      M 1 Reply Last reply 2 Dec 2024, 11:03 Reply Quote 0
      • M
        miguel.barbosa @Rishabh-Webkul last edited by 2 Dec 2024, 11:03

        @Rishabh-Webkul Hello, @Rishabh-Webkul, the getAll method from which class and package?

        1 Reply Last reply Reply Quote 0
        • Rishabh-Webkul
          Rishabh-Webkul last edited by 2 Dec 2024, 11:15

          Hello @miguel-barbosa

          In the ProductController.php file we have implemented a search method where this is used you can take a reference from there

          97349a89-0405-4975-81b5-964fc82d7fe2-image.png

          GitHub File Link

          https://github.com/bagisto/bagisto/blob/master/packages/Webkul/Admin/src/Http/Controllers/Catalog/ProductController.php

          Thanks & Regards

          M 1 Reply Last reply 2 Dec 2024, 12:16 Reply Quote 1
          • M
            miguel.barbosa last edited by 2 Dec 2024, 12:08

            How should I go about filling in the ProductController construct parameters, taking into consideration that search cannot be called statically, can you give me somewhere there's an example of this?

            I want to understand this controller in depth

            1 Reply Last reply Reply Quote 0
            • M
              miguel.barbosa @Rishabh-Webkul last edited by 2 Dec 2024, 12:16

              @Rishabh-Webkul I've extended the ProductController

              But now I want to, using a var, get all products with that value in a specific attribute.

              How can I achieve this with search?

              1 Reply Last reply Reply Quote 0
              4 out of 6
              • First post
                4/6
                Last post