d
Topic
Sam Member
Posts:
3
about 1 month ago

Making featured image the facebook image turned off the variants

So I found out how to make facebook use the featured image by changing the og:image meta field. That seemed to work.

I also figured out from a help article page (https://help.shopify.com/themes/customization/products/variants/show-featured-image-on-product-page) how to display the featured image when the product page is initially loaded as opposed to the first variant being selected and displaying its image. That seemed to work.

But when I made these two changes, something caused the variants in my facebook shop to "disappear" and only an add to cart button is available per product even though there are variants that should be selected.

Does anyone have any thoughts how to re-enable product variants in facebook and yet still display the featured image on load of a product page, and as the main image for each facebook products?

i
Replies
Posts:
18
9 days ago

I have the same problem.... this is not good!

Posts:
18
9 days ago

 {%- capture og_image_tags -%}{% for image in product.images limit:1 -%}<meta property="og:image" content="http:{{ product.featured_image | product_img_url: '1200x1200' }}">{% endfor -%}{% endcapture -%}
    {%- capture og_image_secure_url_tags -%}{% for image in product.images limit:1 -%}<meta property="og:image:secure_url" content="https:{{ product.featured_image | product_img_url: '1200x1200' }}">{% endfor -%}{% endcapture -%}