Is it possible to send images to the variation gallery through the WooCommerce REST API and if you could give me a very basic example of how the data would look that would be very helpful.
We can develop it. Could you assist me? If you have tried API, could you confirm me that
is it possible to ad default image for variation using Rest API?
Yes, I am able to set the default variation image as well as the default image for the parent as well as the parent gallery with the REST API. I found this page where someone claimed they were able to get it to work by sending variant meta data. Any ideas of how to proceed with this?
We’ve updated our plugin for you. Check here: https://wordpress.org/plugins/woo-variation-gallery/#developers
Please check and let me know.
Hello Jonathan Kelaty,
I added gallery response with REST API, when you retrieve variation product via REST API.
you will see that there is also woo_variation_gallery_images response available.
But seems you want to add images via API to the gallery. It’s also possible, Let me explain how.
Open this file:
There is a function named prepare_object_for_database where woocommerce_rest_pre_insert_product_variation_object filter is available to receive your request. Now check how variation images inserted. You will get an idea.
Remember that after processing your request you have to add image ids on woo_variation_gallery_images product meta.
I was able to successfully add images to the variation gallery in my testing, but I have been doing it through image ID. How would you recommend uploading the images via the API and then getting the corresponding image ID’s so I can set them? I don’t see anything mentioned in the WooCommerce documentation about being able to directly manage media in WordPress. If you have any ideas, please let me know.
I see now. Thank you for your help!
If you found our support helpful, could you leave your valuable review here: https://wordpress.org/support/plugin/woo-variation-swatches/reviews/?filter=5
Your rating keeps us inspired.
I was supposed to take rating for the product for which you have taken support.
Could you post your rating here:https://wordpress.org/support/plugin/woo-variation-gallery/reviews/?filter=5
I mistakenly asked rating for our swatches plugin.