问题
It's my online store http://goo.gl/1AJpjN (opencart 1.5.5.1) The challenge is to share the homepage on facebook properly and the product pages as well.
There was no problem with product pages. The addthis.com extension worked quite well, I could see product images with proper title and descriptions on fb... but there was no fb share button for homepage.
So, I added fb share button for homepage in blue horizontal menu using fb normal HTML 5 code from here https://developers.facebook.com/docs/plugins/share-button/
After I did it there is no problem with homepage sharing. Fb shows store logo and proper title with proper description, but when I try to share product pages, fb shows store logo instead of product images.
As I said, The challenge is to share the homepage on facebook properly and the product pages as well. What to do?
回答1:
When you share a page on Facebook, Facebook crawls it and tries to decide which image it should use. If it's showing the wrong one, you can help it by adding a meta tag to the page specifically for this issue. You can find more information here.
An example would be
<meta name="og:image" content="http://www2.intelnet.ge/image/cache/data/uploads/32438HP_PAVILION_TOUCHSMART_11_E100SR__F5B63EA___0_7b_enl-500x500.jpg">
Adding this to your <head>
using OpenCart's templating system can be a bit convoluted, however there are already quite a few extensions that do this. I'd suggest having a look here.
来源:https://stackoverflow.com/questions/26491228/wrong-opencart-product-images-when-i-try-to-share-on-facebook