Inhalte aufrufen

Profilbild

WebApi: Delete ProductImages

webapi productimages

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
9 Antworten zu diesem Thema

#1 TripleNico

TripleNico

    Advanced Member

  • Members
  • 51 Beiträge

Geschrieben: 16 January 2020 - 14:06

So i can succesfully upload images to products but i was wondering how would one delete a product picture? 

This document only describes uploading: https://docs.smartst... Product Images

 

And what would be the way to upload images for categories?



#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3502 Beiträge

Geschrieben: 16 January 2020 - 14:30

Deleting product pictures is not implemented. I added an issue for it.
It's only possible to upload product images using the Web API.

Schöne Grüße aus Düsseldorf,
Marcus Gesing


#3 TripleNico

TripleNico

    Advanced Member

  • Members
  • 51 Beiträge

Geschrieben: 16 January 2020 - 14:48

Well that explains why i could find it  ;)

 

Is there also an endpoint for uploading categorie and manufacturer images? If not, while you at it at Github issue please add it to the Implement list  :)

 

Edit:

Could you give a estimation when this will be available? We are planning to go live this month so it would be very help full if this is implemented.



#4 TripleNico

TripleNico

    Advanced Member

  • Members
  • 51 Beiträge

Geschrieben: 17 January 2020 - 14:47

Thinking outside the box: If i delete the Picture object at endpoint odata/v1/Pictures will this cause removal of the image? (Images are stored at filebase)



#5 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3502 Beiträge

Geschrieben: 17 January 2020 - 15:09

Yes but the picture id assigned to attribute combinations is not removed, if there are any.


Schöne Grüße aus Düsseldorf,
Marcus Gesing


#6 TripleNico

TripleNico

    Advanced Member

  • Members
  • 51 Beiträge

Geschrieben: 17 January 2020 - 15:23

Oké that could be a temp workarround for me to delete ProductPictures if needed while the issue isn't released.

 

I did a GET /odata/v1/Products in Swagger but it didn't returned property collection ProductPictures but there are images assigned to the product? I need this list because i can then check which images with MediaID X i have to delete that matched the ProductPictures.



#7 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3502 Beiträge

Geschrieben: 17 January 2020 - 15:27

Try
GET /odata/v1/Products(product-id)/ProductPictures?$top=100

Schöne Grüße aus Düsseldorf,
Marcus Gesing


#8 TripleNico

TripleNico

    Advanced Member

  • Members
  • 51 Beiträge

Geschrieben: 23 January 2020 - 15:48

I did a GET /odata/v1/Products()?$top=120&$expand=ProductPictures this gives me all the pictures that are tagged with this product. I now try to find the picture by comparing ProductPicture.PictureID with the Picture.ID of endpoint /odata/v1/Pictures but this doesn't gives me a match so i cannot call DELETE /odata/v1/Pictures(XX)

 

Just to be sure if i call DELETE /odata/v1/Products(XX) does this also removes the productpictures?



#9 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3502 Beiträge

Geschrieben: 23 January 2020 - 21:32

No. A product is a primary entity which is marked as deleted and not physically deleted in database, means above delete call has no effect on product pictures.


Schöne Grüße aus Düsseldorf,
Marcus Gesing


#10 TripleNico

TripleNico

    Advanced Member

  • Members
  • 51 Beiträge

Geschrieben: 27 January 2020 - 12:01

Is het dan nog nodig dat wanneer je een product "Delete" om de product foto's te verwijderen?




Auch markiert mit einem oder mehrerer dieser Schlüsselwörter: webapi, productimages