I am setting up a site (WP) which will essentially sell one type of product and integrating a mobile app (ionic).
Multiple vendors can sell (WC Vendors) the variable product on the site at different quantities (100 litres, 200 litres etc).
I need to be able to make a GET request to return each vendors variable product for that quantity.
e.g. Customer selects they want 300 litres in the mobile app, I then use the API to return all variable products for that quantity (300 litres). So in the end, I have a response which will contain something like below;
Vendor: Vendor 1, Product: Product Name, Quantity: 300 litres, Price: £200
Is this possible as the WC API stands now?
2
Answers
For anyone else struggling on this, I finally got it to work by using the tags as suggested above and to query by tags using this;
https://example.com/wp-json/wc/v3/products?tag=20?consumer_key=ck_xxxxxxxxxxxxxxxxx&consumer_secret=cs_2xxxxxxxxxxxxx
I think you need to rephrase this a little bit, But From what I can get. You have a Vendor and a Product that has a Quantity of 300 L which in the first place I’d recommend you Should avoid, Rather just use Liter , Now what I’d Recommend is Tag’s.
You’d have your Vendors and products under Categories.
And you can Set Tags on Products that you’d like to have what you require.
Then When someone Selects 300L , 200L It will pull every Product with the Tag 200L And you’ll be able to display them.
Official Document
They have: