I've been using this code and I think it needs some updating because it sort of has a mind of it's own
I know I have to make sure an Image Type is assigned - Main is what this store uses for the Additional Images but not every product is using the Additional Images. Some products are still using the Legacy Full-sized Images and not pulling in an image
I've noticed that if there are Related Products on the page, the sharing will pull up an image from a Related Product instead of Product.
http://www.serendipitystamps.com/new-stamps/094GD.html
http://www.serendipitystamps.com/new-stamps/093ED.html
So what would be the correct code or better way to do this?
Code:
<mvt:assign name="g.socialURL" value="l.settings:product:link" /> <mvt:assign name="g.socialText" value="'Check out the deal on ' $ l.settings:product:name $ ' at ' $ g.store:name" /> <mvt:do name="l.success" file="g.Module_Library_DB" value="ProductImage_Load_Type(l.settings:product:id, 1, l.settings:imagetype)" /> <mvt:do name="l.success" file="g.Module_Library_DB" value="Image_Load_ID(l.settings:imagetype:image_id, l.settings:imagedata)" /> <mvt:assign name="g.socialImage" value="g.baseurl $ l.settings:imagedata:image" /> <meta property="og:title" content="&mvte:product:name;" /> <meta property="og:type" content="product" /> <meta property="og:image" content="&mvt:global:socialImage;" /> <meta property="og:url" content="&mvt:global:socialURL;" /> <meta property="og:site_name" content="&mvte:global:store:name;" /> <meta property="og:description" content="&mvte:global:socialText;" />
I've noticed that if there are Related Products on the page, the sharing will pull up an image from a Related Product instead of Product.
http://www.serendipitystamps.com/new-stamps/094GD.html
http://www.serendipitystamps.com/new-stamps/093ED.html
So what would be the correct code or better way to do this?
Comment