godaddy-wordpress / woocommerce-memberships-rest-api-docs

WooCommerce Memberships REST API Documentation
https://godaddy-wordpress.github.io/woocommerce-memberships-rest-api-docs/
Other
10 stars 4 forks source link

REST API: How can i get about conditions according of plan. #4

Closed ghost closed 5 years ago

ghost commented 6 years ago

Hi, and thank you for your supported. we install woo-commerce memberships 1.12.2. and create member plan for discount some product. and in rest api document told us about collection data condition. image

but there're not have any data about condition in plans api. please help.

unfulvio commented 6 years ago

Hey there, @GetAlongWell

Currently rules are not exposed in Memberships API responses. We are planning to add support later on, based on merchants and developers feedback. So currently the only way to access and manipulate rules is through PHP methods.

WooCommerce Memberships plan rules are stored in a WordPress option called wc_memberships_rules, therefore you could use the standard WordPress API to fetch the content of this option, which would return a serialized array of data. Each rule will have a reference to a membership plan ID it belongs to.

Please let me know what you are trying to build and how rules support in API endpoints can help you achieve that. This could be valuable feedback to extend the Memberships API.

Thanks

ghost commented 6 years ago

Hi, we use woo-commerce as Service API and use Next.js for All Front-End and Our flexibility Development Team. and that point we want to get list of product in condition membership rules.

How we can get list data product in member codition with wordpress standard api? ( have to pass some parameter? )

Have you can show some sample code or something to get result like this?

Thank you for your supported.

unfulvio commented 6 years ago

hey @GetAlongWell

When rules will be added to the API responses we'll make sure to add some examples as well. Meanwhile, please check the WordPress API docs and the WooCommerce API docs.

For WooCommerce Memberships support questions, please send a support request. Thanks.