How to get product images in the list view with an API call?

This seems way too complicated and slow. Is there a smarter way to do this? Can I get ShopWare to output the 1st image’s path in the Article list response, that’s associated with the current product?

Unfortunately there’s not. And I’m not sure if you’ll be very happy trying to realize your idea with Shopware’s REST-API as it is not designed for that purpose. 

Also I saw that the paths to the images look like this:

/media/image/f5/fb/95/03_200x200.jpg

The first part up to /media/image/ is fixed, that’s straight forward, and I get the image’s filename and extension in the article detail’s response in the media object and even the file extension,

These hexadecimal numbers in front of the name is the MD5-Hash of the original image path. (There are some exceptions though).

Normally it works like this: md5(media/image/thumbnail/03_200x200.jpg) = f5fb9502a051488ca7898e8dc149741e. => /f5/fb/95 … but there are exceptions like „ad“ will be filtered as the path could be blocked by adblockers.

Regards

1 „Gefällt mir“