Liquid、JavaScriptなどに関する質問
Shopifyで商品をアップしてTwitterやFacebook、pinterestにシェアしようとした時、シェアされる画像が商品画像ではなくブランドロゴになってしまいます。
何かアドバイスいただけないでしょうか。
以下がコードになります。
{%- liquid
assign og_title = page_title
if og_title == blank
assign og_title = shop.name | escape
endif
assign og_url = canonical_url | default: shop.url
assign og_type = 'website'
assign og_description = page_description
if og_description == blank
assign og_description = shop.description | default: shop.name | escape
endif
if template.name == 'product'
assign og_type = 'product'
elsif template.name == 'article'
assign og_type = 'article'
elsif template.name == 'collection'
assign og_type = 'product.group'
elsif template.name == 'password'
assign og_url = shop.url
endif
-%}
<meta property="og:site_name" content="{{ shop.name | escape }}">
<meta property="og:url" content="{{ og_url }}">
<meta property="og:title" content="{{ og_title }}">
<meta property="og:type" content="{{ og_type }}">
<meta property="og:description" content="{{ og_description }}">
{%- if page_image -%}
<meta property="og:image" content="http:{{ page_image | img_url: '1200x1200' }}">
<meta property="og:image:secure_url" content="https:{{ page_image | img_url: '1200x1200' }}">
<meta property="og:image:width" content="{{ page_image.width }}">
<meta property="og:image:height" content="{{ page_image.height }}">
{%- endif -%}
{%- if template.name == 'product' -%}
<meta property="og:price:amount" content="{{ product.selected_or_first_available_variant.price | money_without_currency | strip_html }}">
<meta property="og:price:currency" content="{{ cart.currency.iso_code }}">
{%- endif -%}
{%- unless settings.social_twitter_url == blank -%}
<meta name="twitter:site" content="{{ settings.social_twitter_url | split: 'twitter.com/' | last | prepend: '@' }}">
{%- endunless -%}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ og_title }}">
<meta name="twitter:description" content="{{ og_description }}">
Shopifyペイメント決済サービスを利用していて、ストアの管理画面の通知セクションに突然「Shopifyペイメントの使用を継続するために必要な情報」というバナーメッセージが表示さ...
By Mirai Dec 3, 2023すべてのShopifyアカウントはデフォルトではmyshopify.comのURLと関連付けられており、これはアカウント設定時に使用したビジネス名に基づいて作成されます。しかし、オ...
By Nina_13 Nov 26, 2023このトピックは英語版コミュニティの投稿:Shopify Web Pixel Manager Sandbox FAQの日本翻訳です。
By Mirai Nov 19, 2023