Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › API how can I search one product with a substring of its name
- This topic has 4 replies, 4 voices, and was last updated 5 years, 5 months ago by Sayan Naskar.
- AuthorPosts
- May 29, 2019 at 8:50 am #64255JackGuest
Hi, I’m working with the API of the plug in, I’m seeing that I can search a product with the id or slug but not with a substring of product name.
Is there any option to modify the API in order to apply the search query for a specific product or a group of products that contains a substring of their name.Similar with the like condition on a query like ‘%partOfProductName%’
- May 31, 2019 at 6:45 pm #65224WCFM ForumMember
Hi,
Are you using this API plugin ? https://wordpress.org/plugins/wcfm-marketplace-rest-api/
Thank You
- June 1, 2019 at 7:54 am #65388Sayan NaskarMember
Hello,
If you want to search for a specific part of the product name ie substring of the product names with the WooCommerce Multivendor Marketplace – REST API plugin https://wordpress.org/plugins/wcfm-marketplace-rest-api/
use search query string in the url of the API call ie/wp-json/wcfmmp/v1/products/?search=%partOfProductName%
For example:
In case of our demo site to list all products with Apple as substring the api call should be made in the url http://wcfmmp.wcfmdemos.com/wp-json/wcfmmp/v1/products/?search=Apple - June 7, 2019 at 12:24 pm #66390ermandhoxha1994Participant
It’s possible to search products from all vendors, not only products that belong logged user.
- June 7, 2019 at 12:58 pm #66397Sayan NaskarMember
Hello,
When you call the Api with the vendors credentials or token it will only display products of that particular vendor and also search substring of the products of that vendor.Thank you.
- AuthorPosts
- You must be logged in to reply to this topic.