How is it possible to add additional product images without replacing existing
-
I am using the version=”wc/v3″, of the woocommerce rest api.
I want to add additional image(s) to a product , without the new images overwriting the old.
I am using the api in Python.
Ex:
old_images = [“1” , “2”]
new_images = [“3” , “4”]after updating the product the final list is : final_list = [“3” , “4”]
but i want to be : final_list = [“1” , “2”, “3” , “4”]Is it possible to achieve to upadate my list in this way?
The same question posted : here
but without a clear solutionMy code:
def update_woocommerce_product_individually(wcapi,mixed_name,fetched_sku,short_description,description,woo_commerce_category_id,post_id,photo_gallery_dictionary_list): data = { "name":mixed_name, "short_description":short_description, "description":description, "images":photo_gallery_dictionary_list } wcapi.put("products/"+str(post_id), data).json()
The
photo_gallery_dictionary_list
variable is holding the new_images = [“3” , “4”]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How is it possible to add additional product images without replacing existing’ is closed to new replies.