app/template/smartphone/Product/detail.twig line 1

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% form_theme form 'Form/form_div_layout.twig' %}
  3. {% block javascript %}
  4.     <style>
  5.         /* Number inputのアップダウンボタンを非表示にする */
  6.         input[type="number"]::-webkit-inner-spin-button,
  7.         input[type="number"]::-webkit-outer-spin-button {
  8.             -webkit-appearance: none;
  9.             margin: 0;
  10.         }
  11.         input[type="number"] {
  12.             -moz-appearance: textfield; /* Firefox用 */
  13.         }
  14.     </style>
  15.     <script>
  16.         $(function() {
  17.             $('.bxslider').bxSlider({
  18.                 auto: true
  19.             });
  20.         });
  21.         window.fbAsyncInit = function() {
  22.             FB.init({
  23.                 appId      : '1011828268866109',
  24.                 xfbml      : true,
  25.                 status     : true,
  26.                 cookie     : true,
  27.                 channelURL : "{{ url('product_detail', {'id': Product.id}) }}",
  28.                 oauth      : true,
  29.                 version    : 'v2.6'
  30.             });
  31.         };
  32.         (function(d, s, id){
  33.             var js, fjs = d.getElementsByTagName(s)[0];
  34.             if (d.getElementById(id)) {return;}
  35.             js = d.createElement(s); js.id = id;
  36.             js.src = "//connect.facebook.net/ja_JP/sdk.js";
  37.             fjs.parentNode.insertBefore(js, fjs);
  38.         }(document, 'script', 'facebook-jssdk'));
  39.         // 数量の増加
  40.         function plus(psms){
  41.             psms.value++;
  42.             if (psms.value > 1000){
  43.                 psms.value = 1000;
  44.             }
  45.         }
  46.         // 数量の減少
  47.         function minus(psms){
  48.             psms.value--;
  49.             if (psms.value < 1){
  50.                 psms.value = 1;
  51.             }
  52.         }
  53.         // カートモード
  54.         function cartmode(){
  55.             $('#sns').hide();
  56.             $('#cartbutton').hide();
  57.             $('#cart').show();
  58.         }
  59.     </script>
  60. {% endblock javascript %}
  61. {% set catefl = 0 %}
  62. {% for category in Product.ProductCategories %}
  63.     {% if category.Category.id == 315 %}
  64.         {% set catefl = 1 %}
  65.     {% endif %}
  66. {% endfor %}
  67. {% block main %}
  68. <!DOCTYPE html>
  69. <html>
  70. <head>
  71. <meta charset="UTF-8">
  72. {# ▼ ブロック:DispHtag ▼ #}
  73. {{ include('Block/DispHtag.twig') }}
  74. {# ▲ ブロック:DispHtag ▲ #}
  75. <title>ベースボール・マガジン社 BBM@BOOK CART</title>
  76. <meta name="description" content="ベースボール・マガジン社が運営する総合スポーツサイト。ベースボール・マガジン社発行の書籍・雑誌・スポーツカードなどの新着情報、各競技の技術情報や専門家によるコラムなど、スポーツファンを応援する情報が満載です。">
  77. <meta name="keywords" content="ベースボールマガジン社,BBM">
  78. <meta property="og:title" content="{{ Product.name }}" />
  79. <meta property="og:type" content="website" />
  80. <meta property="og:url" content="{{ app.request.uri }}" />
  81. <meta property="og:image" content="{{ absolute_url(asset(Product.main_list_image|no_image_product, 'save_image')) }}">
  82. <meta property="og:site_name" content="ベースボールマガジン社" />
  83. <meta property="og:description" content="{{ Product.description_list|raw|nl2br }}" />
  84. {# ▼ ブロック:DispHead ▼ #}
  85. {{ include('Block/DispHead.twig') }}
  86. {# ▲ ブロック:DispHead ▲ #}
  87. </head>
  88. <body id="pagetop">
  89. {# ▼ ブロック:DispBtag ▼ #}
  90. {{ include('Block/DispBtag.twig') }}
  91. {# ▲ ブロック:DispBtag ▲ #}
  92. {# ▼ ブロック:DispHeader ▼ #}
  93. {% if catefl == 0 %}
  94.     {{ include('Block/DispHeader.twig') }}
  95. {% else %}
  96.     {{ include('Block/DispHeaderLp.twig') }}
  97. {% endif %}
  98. {# ▲ ブロック:DispHeader ▲ #}
  99. {% if catefl == 0 %}
  100.     <div id="main-content" style="background-image: linear-gradient(#f9f9f9, #eee);">
  101. {% endif %}
  102. {% set Cate3nd = null %}
  103. {% set Cate2nd = null %}
  104. {% if Product.ProductCategories is not empty %}
  105.     {% for category in Product.ProductCategories %}
  106.         {% if category.Category.hierarchy > 1 %}
  107.             {% if category.Category.hierarchy == 2 %}
  108.                 {% set Cate2nd = category.Category %}
  109.             {% endif %}
  110.         {% endif %}
  111.         {% if category.Category.hierarchy > 2 %}
  112.             {% if category.Category.hierarchy == 3 %}
  113.                 {% set Cate3nd = category.Category %}
  114.             {% endif %}
  115.         {% endif %}
  116.     {% endfor %}
  117. {% endif %}
  118. {% if catefl == 0 %}
  119.     <div class="clearfix">
  120.         <!--▼ IMAGE ▼-->
  121.         <div class="mag_img">
  122.             <p class="mb5">
  123.                 <section id="info4">
  124.                     <section id="mainbnr4">
  125.                         {% if Product.ProductImage|length > 1 %}
  126.                             <div class="bxslider">
  127.                                 {% for ProductImage in Product.ProductImage %}
  128.                                     <img src="{{ asset(ProductImage, 'save_image') }}" style="width:100%;" />
  129.                                 {% else %}
  130.                                     <img src="{{ asset(''|no_image_product, 'save_image') }}" style="width:100%;" />
  131.                                 {% endfor %}
  132.                             </div>
  133.                         {% else %}
  134.                             {% set image = Product.ProductImage|first ?: ''|no_image_product %}
  135.                             <img src="{{ asset(image, 'save_image') }}" style="width:100%;" />
  136.                         {% endif %}
  137.                     </section>
  138.                 </section>
  139.             </p>
  140.             <div class="mag_img_zoom">
  141.                 <!-- ▼ 拡大画像 ▼ -->
  142.                 <a href="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}" data-lightbox="image-1" data-title="{{ Product.name }}" data-alt="{{ Product.name }}" target="_blank">画像を拡大する</a>
  143.                 <!-- ▲ 拡大画像 ▲ -->
  144.             </div>
  145.         </div>
  146.         <!--▲ IMAGE ▲-->
  147.         <!--▼ TXT ▼-->
  148.         <div class="mag_txtarea">
  149.             <p class="mb45">
  150.                 {% if Product.linkurl %}
  151.                     <a href="{{ Product.linkurl }}">
  152.                 {% endif %}
  153.                 <!-- ▼ 商品名 ▼ -->
  154.                 <span class="style-title1">
  155.                     {{ Product.name|raw|nl2br }}
  156.                 </span>
  157.                 <!-- ▲ 商品名 ▲ -->
  158.                 {% if Product.linkurl %}
  159.                     </a>
  160.                 {% endif %}
  161.                 <br>
  162.                 {{ Product.comment1 }}<br>
  163.                 {{ Product.hatsubaibi }}<br>
  164.                 <!-- ▼ 商品コード ▼ -->
  165.                 {% if Product.code_min is not empty %}
  166.                     {{ Product.code_min }}{% if Product.code_min != Product.code_max %} ~ {{ Product.code_max }}{% endif %}<br>
  167.                 {% endif %}
  168.                 <!-- ▲ 商品コード ▲ -->
  169.                 <!-- ▼ 印刷物サイズ ▲ -->
  170.                 {{ Product.jissize }}<br>
  171.                 <!-- ▲ 印刷物サイズ ▲ -->
  172.                 {{ Product.teikaref }}
  173.                 <!-- ▼ 販売価格 ▼ -->
  174.                 {% if Product.hasProductClass %}
  175.                     {% if Product.getPrice02Min == Product.getPrice02Max %}
  176.                         {{ Product.getPrice02IncTaxMin|number_format }}円(税込)<br>
  177.                     {% else %}
  178.                         {{ Product.getPrice02IncTaxMin|number_format }} ~ {{ Product.getPrice02IncTaxMax|number_format }}円(税込)<br>
  179.                     {% endif %}
  180.                 {% else %}
  181.                     {{ Product.getPrice02IncTaxMin|number_format }}円(税込)<br>
  182.                 {% endif %}
  183.                 <!-- ▲ 販売価格 ▲ -->
  184.                 <!-- ▼ ISBNコード ▼ -->
  185.                 {% if Product.isbn %}
  186.                     ISBN:{{ Product.isbn }}<br>
  187.                 {% endif %}
  188.                 <!-- ▲ ISBNコード ▲ -->
  189.             </p>
  190.             <form action="{{ url('product_add_cart', {id:Product.id}) }}" method="post" id="form1" name="form1">
  191.                 {% if Product.stock_find %}
  192.                     <!--▼ カートへ ▼-->
  193.                     <div class="cartin_btn" id="cart" style="display:none; margin-bottom:10px;">
  194.                         <dl>
  195.                             <dt>数量</dt>
  196.                             <dd>
  197.                                 <p style="margin-bottom:10px;">{{ form_widget(form.quantity, { attr : { class : "quantitybox"} }) }}</p>
  198.                                 <a onclick="plus(document.getElementById('quantity')); return false">
  199.                                     <img src="{{ asset('common_img/button/btn_plus.jpg', 'user_data') }}" style="width:21px; margin-right:10px;" alt="+">
  200.                                 </a>
  201.                                 <a onclick="minus(document.getElementById('quantity')); return false" alt="+">
  202.                                     <img src="{{ asset('common_img/button/btn_minus.jpg', 'user_data') }}" style="width:21px" alt="-">
  203.                                 </a>
  204.                                 {{ form_errors(form.quantity) }}
  205.                             </dd>
  206.                         </dl>
  207.                         <!--★カートに入れる★-->
  208.                         <div id="cartbtn_default" style="margin-top:10px;">
  209.                             <a rel="external" href="javascript:void(document.form1.submit());" class="btn cartbtn_default"><img src="{{ asset('sp/images/ec-cube/btn_cartin_on.jpg', 'user_data') }}" style="width:160px; height:30px; margin:5px 0px 5px 0px;" ></a>
  210.                         </div>
  211.                         <div class="attention" id="cartbtn_dynamic"></div>
  212.                     </div>
  213.                     <!--▲ カートへ ▲-->
  214.                 {% endif %}
  215.                 {{ form_rest(form) }}
  216.             </form>
  217.             <!--▼ SNS ▼-->
  218.             <div class="mag_sns" id="sns">
  219.                 <div class="mag_fb">
  220.                     <div class="fb-like" data-href="{{ url('product_detail', {'id': Product.id}) }}" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true"></div>
  221.                     <a href="https://twitter.com/share" class="twitter-share-button" data-lang="ja">ツイート</a>
  222.                     <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
  223.                 </div>
  224.             </div>
  225.             <!--▲ SNS ▲-->
  226.             <!--▼ BTN ▼-->
  227.             <ul class="mag_btnarea" id="cartbutton">
  228.                 {% if Product.amazon %}
  229.                     <li><a href="http://www.amazon.co.jp/dp/{{ Product.amazon }}?tag=fieldlogos-22" target="_blank"><img src="{{ asset('common_img/amazon_logo2.png', 'user_data') }}" alt="amazon.co.jpで買う"></a></li>
  230.                 {% endif %}
  231.                 {% if Product.stock_find %}
  232.                     {% if Cate3nd and Cate3nd.id not in [35, 46] %}
  233.                         {% if Product.bookcart != 1 %}
  234.                             <li class="mb10"><img src="{{ asset('common_img/bookcart_logo.gif', 'user_data') }}" alt="カート" onclick="cartmode();"></li>
  235.                         {% endif %}
  236.                     {% endif %}
  237.                 {% else %}
  238.                     {% if Cate3nd and Cate3nd.id not in [35, 46] %}
  239.                         {% if Product.bookcart != 1 %}
  240.                             <li class="mb10"><img src="{{ asset('common_img/zaikogire.gif', 'user_data') }}" alt="カート" onclick="cartmode();"></li>
  241.                         {% endif %}
  242.                     {% endif %}
  243.                 {% endif %}
  244.                 {% if Cate3nd and Cate3nd.id not in [49, 44, 75, 70, 57, 73] %}
  245.                     {% if Cate3nd and Cate3nd.teikikoudoku1 > 0 %}
  246.                         <li class="mb10"><a href="http://bbm-subscribe.com/products/detail.php?product_id={{ Cate3nd.teikikoudoku1 }}" target="_blank"><img src="{{ asset('common_img/btn01.jpg', 'user_data') }}" alt="定期購読"></a></li>
  247.                     {% endif %}
  248.                     {% if Cate3nd and Cate3nd.teikikoudoku2 > 0 %}
  249.                         <li><a href="http://bbm-subscribe.com/postal/products/detail.php?product_id={{ Cate3nd.teikikoudoku2 }}" target="_blank"><img src="{{ asset('common_img/btn02.jpg', 'user_data') }}" alt="定期購読"></a></li>
  250.                     {% endif %}
  251.                 {% endif %}
  252.             </ul>
  253.             <!--▲ BTN ▲-->
  254.         </div>
  255.     </div>
  256.     <section class="box01">
  257.         <h2>コンテンツ<span>CONTENTS</span></h2>
  258.         {{ Product.description_detail|raw }}
  259.     </section>
  260.     <!--▼ SECTION ▼-->
  261.     <!--▼ BNR ▼-->
  262.     <section id="mainbnr2">
  263.     <div class="bxslider">
  264.         {% if Banners %}
  265.             {% for Banner in Banners %}
  266.                 {% for cnt in 1..30 %}
  267.                     {% set cntdsp = '%02d'|format(cnt) %}
  268.                     {% set image = Banner['image'~cntdsp] %}
  269.                     {% set link = Banner['link'~cntdsp] %}
  270.                     {% set blank = Banner['blank'~cntdsp] %}
  271.                     {% if image %}
  272.                         {% if blank == 1 %}
  273.                             {% set dspBlank = 'target="_blank"' %}
  274.                         {% else %}
  275.                             {% set dspBlank = '' %}
  276.                         {% endif %}
  277.                         <a href="{{ link }}" {{ dspBlank }}><img src="{{ asset('', 'save_image') }}/visual_{{ Banner.id }}/{{ image }}" width="240"></a>
  278.                     {% endif %}
  279.                 {% endfor %}
  280.             {% endfor %}
  281.         {% endif %}
  282.     </section>
  283.     <!--▲ BNR ▲-->
  284.     <!--▲ SECTION ▲-->
  285.     {% if RecommendList %}
  286.         <!--▼おすすめ商品-->
  287.         <section id="info">
  288.             <h2>おすすめ商品<span>Recommend</span></h2>
  289.             <!--▼ SECTION ▼-->
  290.             <section id="mainbnr3">
  291.                 <div class="bxslider">
  292.                     {% for Recommend in RecommendList %}
  293.                         <!--▼ ARTICLE ▼-->
  294.                         <a href="{{ url('product_detail', {'id': Recommend.id}) }}"><img src="{{ asset(Recommend.main_list_image|no_image_product, 'save_image') }}" alt="{{ Recommend.name }}" /></a>
  295.                         <!--▲ ARTICLE ▲-->
  296.                     {% endfor %}
  297.                 </div>
  298.             </section>
  299.         </section>
  300.         <!--▲おすすめ商品-->
  301.     {% endif %}
  302.     <!--▼ SECTION ▼-->
  303.     <section id="category">
  304.       <h2>商品ジャンルを選ぶ</h2>
  305.       <nav>
  306.         <ul class="clearfix">
  307.             {% if Cate2nd %}
  308.                 {% for child_category in Cate2nd.children|reverse %}
  309.                     {% if child_category.dspfl == 1 %}
  310.                         <li><a href="{{ path('product_list', {cateid: child_category.id}) }}">{{ child_category.name }}</a></li>
  311.                     {% endif %}
  312.                 {% endfor %}
  313.             {% endif %}
  314.         </ul>
  315.       </nav>
  316.     </section>
  317.     <!--▲ SECTION ▲-->
  318. {% else %}
  319.     <!--A-FORM ランディングページのとき-->
  320.     <div id="container" class="w1000">
  321.         <div id="content" class="w810">
  322.             <div id="contentbox">
  323.                 {{ Product.description_detail|raw }}
  324.             </div>
  325.         </div>
  326.     </div>
  327. {% endif %}
  328. {# ▼ ブロック:DispFooter ▼ #}
  329. {{ include('Block/DispFooter.twig') }}
  330. {# ▲ ブロック:DispFooter ▲ #}
  331. {# ▼ ブロック:DispFtag ▼ #}
  332. {{ include('Block/DispFtag.twig') }}
  333. {# ▲ ブロック:DispFtag ▲ #}
  334. </div>
  335. </body>
  336. </html>
  337. {% endblock %}
  338. {# ▲ main ▲ #}