Skip to main content
1 of 3

How can I get a product's image URL using service contracts?

I know that in Magento 2.0, there is a recommended way to access products info from another module using service contracts.

So, my first question: how can I get a product's image URL using service contracts and an API function?

Second question: I want to override product's possible "getImageUrl" function so that I can generate a custom URL (points to an external source) and return it back as Image URL. So, any other external or internal module that wants to access a product's image's URL will get my generated URL instead of Magento's default product Image URL. Should it be implemented using service contracts ? Because its the recommended way in Magento 2.0.