In my e-commerce application when i paste a url to facebook or others social site there is no image passed with that url.
i want to show the url and spceific product wise picture and title.
How can i do it?
So this doesn't really work that way. A page can only have one og:image object. So if you want an image on the homepage of your app you either need to pick a product or use the logo of your site.
On the single product page you can use the og:image for a specific product. That's the only way that works.
@BOBBYBOUWMANN - Thanks for your response.
so, i need to add og:image in each page?
but my all product is dynaic so how can i implement it i don't understand.
You need to add this depending on the data that is showing on that page. So your code is working perfectly, except you don't have to loop over all images. You already have this data available!