How to update mapped images with it's variant via REST API

Hello,

Thank you in advance,

I am creating articles via REST API provided by Shopware and mapping the images with variations. the article creation is working ok. onwards I want to update the article via PUT method of REST API, the details are updating fine but the image is inserting again instead of Updation of image mapping with variants.

@Hahu Smith, so this can not be resolved, I mean we can’t do that right?

Regards,

Ronak Solanki

one way is looking for the image name in database and return the media ID

then use the media ID to upadte the images mapping.

the other way is to use the option ‘__options_images’  => [‘replace’ => true]

then your call will upload new images with new mapping and replace the old images.

but this will not delete the old images from the media manager , by every call new images will be uploaded

VG,

Tel.: +49 755 - 183 990 00 | Email: info@enbit.de | Web: http://enbit.de/

1 „Gefällt mir“

@ahmadsaad schrieb:

one way is looking for the image name in database and return the media ID

then use the media ID to upadte the images mapping.

the other way is to use the option ‚__options_images‘  => [‚replace‘ => true]

then your call will upload new images with new mapping and replace the old images.

but this will not delete the old images from the media manager , by every call new images will be uploaded

VG,

Ahmad 

 

@ahmadsaad, Thank you so much for your reply and I have used your solution and it is working fine and exactly what I was looking for. Thank You so much