{% if app.request.get('_route') == 'product_detail' %}
{% set meta_og_type = "og:product" %}
{% set meta_description = Product.description_list | default(Product.description_detail) | default(Page.description) %}
{% set meta_canonical = url('product_detail', {'id': Product.id}) %}
<meta property="og:title" content="{{ Product.name }}" />
<meta property="og:image" content="{{ absolute_url(asset(Product.main_list_image|no_image_product, 'save_image')) }}" />
<meta property="product:price:amount" content="{{ Product.getPrice02IncTaxMin }}"/>
<meta property="product:price:currency" content="{{ eccube_config.currency }}"/>
<meta property="product:product_link" content="{{ url('product_detail', {'id': Product.id}) }}"/>
<meta property="product:retailer_title" content="{{ BaseInfo.shop_name }}"/>
{% if not Product.stock_find %}
<meta name="robots" content="noindex">
{% endif %}
{% elseif app.request.get('_route') == 'product_list' %}
{% set meta_canonical = url('product_list', {'category_id': Category.id|default(null)}) %}
{% if pagination|length == 0 %}
<meta name="robots" content="noindex">
{% endif %}
{% elseif app.request.get('_route') == 'homepage' %}
{% set meta_og_type = 'website' %}
{% set meta_canonical = url('homepage') %}
{% elseif Page is defined and Page.edit_type == 0 and Page.url is defined %}
{% set meta_canonical = url(eccube_config.eccube_user_data_route, {'route': Page.url}) %}
{% endif %}
{% if app.request.host == 'stg-renewal.manaka-store.com' %}
<meta name="robots" content="noindex,nofollow">
{% endif %}
{% if app.request.pathinfo == '/shopping/complete' %}
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'value': {{ Order.total }},
'transaction_id': '{{ Order.id }}',
'email': '{{ Order.email }}',
'phone_number': '{{ Order.phone_number }}'.replace(/[^0-9]/g,'').replace('0','+81')
});
</script>
{% endif %}
{% if app.request.host == 'manaka-store.com' %}
<!-- Google Tag Manager -->
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-NG6V73PT');
</script>
<!-- End Google Tag Manager -->
<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NG6V73PT"
height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->
{% endif %}
<meta property="og:type" content="{{ meta_og_type|default('article') }}"/>
<meta property="og:site_name" content="{{ BaseInfo.shop_name }}"/>
{% set meta_description = meta_description | default(Page.description) %}
{% if meta_description %}
<meta name="description" content="{{ meta_description|striptags|slice(0,120) }}">
<meta property="og:description" content="{{ meta_description|striptags|slice(0,120) }}"/>
{% endif %}
{% if meta_canonical|default() %}
{# canonical url #}
{# Product list #}
{% if Category is defined and Category %}
{% if pagination is defined and pagination.paginationData is defined and pagination.paginationData.pageCount > 1 %}
{# 最初のページ #}
{% if pagination.paginationData.current == 1 %}
<meta property="og:url" content="{{ meta_canonical }}"/>
<link rel="next" href="{{ meta_canonical }}&pageno=2" title="{{ Category.name }} {{ 'front.product.pageno'|trans({ '%pageno%': 2 }) }}">
<link rel="canonical" href="{{ meta_canonical }}" />
{# 最後のページ #}
{% elseif pagination.paginationData.last == pagination.paginationData.current %}
<meta property="og:url" content="{{ meta_canonical }}&pageno={{ pagination.paginationData.last }}"/>
<link rel="prev" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.previous }}" title="{{ Category.name }} {{ 'front.product.pageno'|trans({ '%pageno%': pagination.paginationData.previous }) }}">
<link rel="canonical" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.last }}" />
{# 途中のページ #}
{% else %}
<meta property="og:url" content="{{ meta_canonical }}&pageno={{ pagination.paginationData.current }}"/>
<link rel="next" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.next }}" title="{{ Category.name }} {{ 'front.product.pageno'|trans({ '%pageno%': pagination.paginationData.next }) }}">
<link rel="prev" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.previous }}" title="{{ Category.name }} {{ 'front.product.pageno'|trans({ '%pageno%': pagination.paginationData.previous }) }}">
<link rel="canonical" href="{{ meta_canonical }}&pageno={{ pagination.paginationData.current }}" />
{% endif %}
{% else %}
{# ページング無し #}
<meta property="og:url" content="{{ meta_canonical }}"/>
<link rel="canonical" href="{{ meta_canonical }}" />
{% endif %}
{# Other #}
{% else %}
<meta property="og:url" content="{{ meta_canonical }}"/>
<link rel="canonical" href="{{ meta_canonical }}" />
{% endif %}
{% endif %}