Delete product image

James Mosquito asked on November 13, 2020 13:26

Hi, Are there any API methods available to retrieve and delete product images from within a CMS FormControl?

Recent Answers


Brenden Kehren answered on November 13, 2020 16:15

See the Product API examples. If you're using the out of the box image, you'd set the SKUImagePath property to an empty string.

0 votesVote for this answer Mark as a Correct answer

David te Kloese answered on November 13, 2020 16:17

The default image for a SKU is stored in the SKU.SKUImagePath so you would need to clear that.

The default Form Control for this field is the Product Image Selector. I would start with that one, code can be found at ~/CMSModules/Ecommerce/FormControls/SelectProductImage.ascx

0 votesVote for this answer Mark as a Correct answer

James Mosquito answered on November 15, 2020 20:02 (last edited on November 15, 2020 20:03)

Thank you both.

I have tried emptying the SKU.SKUImagePath property as you suggest but the image is still showing up. I called sku.Update() and SKUInfoProvider.SetSKUInfo(sku) immediately after.

The reason I asked howto clear the image is because I had actually been trying to replace the existing image but noticed that a new copy is added instead (screenshot attached below):

Screenshot

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.