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

Bagisto

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

haven't found product search api...

General Discussion
3
3
329
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.
  • N
    nahiyan.aziz last edited by 5 Jul 2020, 11:56

    i was searching api which returns me matched result of my search key which is available in web but not in api.. what i found is

    http(s)://example.com/public/api/products?name=’Leather Shoes’

    but this has not worked for me. it hasn't return me the specific product rather it returns me all products....

    whats wrong.?

    1 Reply Last reply Reply Quote 0
    • S
      shivam-webkul last edited by 6 Jul 2020, 15:14

      Please specify the bagsito version.

      Thanks

      1 Reply Last reply Reply Quote 0
      • 6 months later
      • A
        aliraza last edited by 6 Jan 2021, 10:34

        In api , it is retreiving data on the behalf of term. Try send term instead of name or try this in index method of ProductController.

        //name into term
        $request = request()->all();
        if(isset($request['name'])){
        $request['term'] = $request['name'];
        }
        // category_id into category
        if(isset($request['category_id'])){
        $request['category'] = $request['category_id'];
        }

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