calatonsystems / wc-api-java

Java wrapper for WooCommerce REST API
MIT License
98 stars 77 forks source link

Suppor for product variations #11

Open dcoturel opened 6 years ago

dcoturel commented 6 years ago

Hi, icoderman, I have another issue with dealing with product variations. In the case of an update, you have to call the api with two params:

/products/:product_id/variations/:variation_id

The current update() method requires one id parameter, and uses this to assign the last String.format placeholder. You think there is a way to handle this without modifying current WooCommerce interface?

Regards

Danc2050 commented 1 year ago

You can put it in a batch and use the String.format() function: https://github.com/calatonsystems/wc-api-java/blob/efdaabcc90431556caf7966152eb757de1f42f36/src/test/java/com/icoderman/woocommerce/integration/WooCommerceClientTest.java#L93