cancel
Showing results for 
Search instead for 
Did you mean: 

How to assign roles after deleting the default image with 'all roles' and saving the product

How to assign roles after deleting the default image with 'all roles' and saving the product

How to assign roles to the successive images after deleting the default image with 'all roles' and saving the product?

If the first image of a product is uploaded, the system automatically selects all roles. However, if the image is edited or replaced, the roles are not selected by default, which may cause the product to appear without any images if the person forgets to select the roles. I would like to automatically select all roles for the replacement or edited image. How should I write the code to assign all roles to the replacement image after the previous image's roles are deleted?

image.png