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

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% block javascript %}
  3.     
  4.     <style>
  5.         .mag_sns {
  6.             margin: 0 0 5px;
  7.             height: 60px;
  8.             display: table-cell;
  9.             vertical-align: bottom;
  10.         }
  11.         /* Number inputのアップダウンボタンを非表示にする */
  12.         input[type="number"]::-webkit-inner-spin-button,
  13.         input[type="number"]::-webkit-outer-spin-button {
  14.             -webkit-appearance: none;
  15.             margin: 0;
  16.         }
  17.         input[type="number"] {
  18.             -moz-appearance: textfield; /* Firefox用 */
  19.         }
  20.         .lSSlideOuter {
  21.             width:230px;
  22.             overflow: hidden;
  23.             -webkit-touch-callout: none;
  24.             -webkit-user-select: none;
  25.             -khtml-user-select: none;
  26.             -moz-user-select: none;
  27.             -ms-user-select: none;
  28.             user-select: none
  29.         }
  30.     </style>
  31.     <script>
  32.         $(document).ready(function () {
  33.             $("#lightSlider").lightSlider({
  34.                 item:1,
  35.                 auto: true,
  36.                 speed: 500,
  37.                 pause: 4000,
  38.                 gallery:true,
  39.                 showThumbByDefault:true,
  40.                 thumbItem:5,
  41.                 loop: true,
  42.                 adaptiveHeight:true 
  43.             }); 
  44.         });
  45.         window.fbAsyncInit = function() {
  46.             FB.init({
  47.                 appId      : '1011828268866109',
  48.                 xfbml      : true,
  49.                 status     : true,
  50.                 cookie     : true,
  51.                 channelURL : "{{ url('product_detail', {'id': Product.id}) }}",
  52.                 oauth      : true,
  53.                 version    : 'v2.6'
  54.             });
  55.         };
  56.         (function(d, s, id){
  57.             var js, fjs = d.getElementsByTagName(s)[0];
  58.             if (d.getElementById(id)) {return;}
  59.             js = d.createElement(s); js.id = id;
  60.             js.src = "//connect.facebook.net/ja_JP/sdk.js";
  61.             fjs.parentNode.insertBefore(js, fjs);
  62.         }(document, 'script', 'facebook-jssdk'));
  63.         // 数量の増加
  64.         function plus(psms){
  65.             psms.value++;
  66.             if (psms.value > 1000){
  67.                 psms.value = 1000;
  68.             }
  69.         }
  70.         // 数量の減少
  71.         function minus(psms){
  72.             psms.value--;
  73.             if (psms.value < 1){
  74.                 psms.value = 1;
  75.             }
  76.         }
  77.         // カートモード
  78.         function cartmode(){
  79.             $('#sns').hide();
  80.             $('#cartbutton').find('ul').hide();
  81.             $('#cart').show();
  82.         }
  83.     </script>
  84. {% endblock javascript %}
  85. {% set catefl = 0 %}
  86. {% for category in Product.ProductCategories %}
  87.     {% if category.Category.id == 315 %}
  88.         {% set catefl = 1 %}
  89.     {% endif %}
  90. {% endfor %}
  91. {% block main %}
  92. <!DOCTYPE html>
  93. <html>
  94. <head>
  95. <meta charset="UTF-8">
  96. {# ▼ ブロック:DispHtag ▼ #}
  97. {{ include('Block/DispHtag.twig') }}
  98. {# ▲ ブロック:DispHtag ▲ #}
  99. <title>ベースボール・マガジン社 BBM@BOOK CART</title>
  100. <meta name="description" content="ベースボール・マガジン社が運営する総合スポーツサイト。ベースボール・マガジン社発行の書籍・雑誌・スポーツカードなどの新着情報、各競技の技術情報や専門家によるコラムなど、スポーツファンを応援する情報が満載です。">
  101. <meta name="keywords" content="ベースボールマガジン社,BBM">
  102. <meta property="og:title" content="{{ Product.name }}" />
  103. <meta property="og:type" content="website" />
  104. <meta property="og:url" content="{{ app.request.uri }}" />
  105. <meta property="og:image" content="{{ absolute_url(asset(Product.main_list_image|no_image_product, 'save_image')) }}">
  106. <meta property="og:site_name" content="ベースボールマガジン社" />
  107. <meta property="og:description" content="{{ Product.description_list|raw|nl2br }}" />
  108. {# ▼ ブロック:DispHead ▼ #}
  109. {% if catefl == 0 %}
  110.     {{ include('Block/DispHead.twig') }}
  111. {% else %}
  112.     {{ include('Block/DispHead2.twig') }}
  113. {% endif %}
  114. {# ▲ ブロック:DispHead ▲ #}
  115. </head>
  116. <body id="pagetop" class="top">
  117. {# ▼ ブロック:DispBtag ▼ #}
  118. {{ include('Block/DispBtag.twig') }}
  119. {# ▲ ブロック:DispBtag ▲ #}
  120. {# ▼ ブロック:DispHeader ▼ #}
  121. {% if catefl == 0 %}
  122.     {{ include('Block/DispHeader.twig') }}
  123. {% else %}
  124.     {{ include('Block/DispHeaderLp.twig') }}
  125. {% endif %}
  126. {# ▲ ブロック:DispHeader ▲ #}
  127. {% if catefl == 0 %}
  128.     <!--▼ CONTAINER ▼-->
  129.     <div id="container" class="clearfix">
  130.         {% set Cate3nd = null %}
  131.         {% set Cate2nd = null %}
  132.         {% set sportscard = 0 %}
  133.         <!--▼ パンくず ▼-->
  134.         <p id="topicpath">
  135.             {% if Product.ProductCategories is not empty %}
  136.                 <a href="{{ url('bookcart') }}">ホーム</a>
  137.                 {% for category in Product.ProductCategories %}
  138.                     {% if category.Category and category.Category.id == 31 %}
  139.                         {% set sportscard = 1 %}
  140.                     {% endif %}
  141.                     {% if category.Category.hierarchy > 1 %}
  142.                         {% if category.Category.hierarchy == 2 %}
  143.                             {% set Cate2nd = category.Category %}
  144.                         {% endif %}
  145.                         <a href="{{ url('product_list', {cateid: category.Category.id}) }}">&nbsp;&gt&nbsp{{ category.Category.name }}</a>
  146.                     {% endif %}
  147.                     {% if category.Category.hierarchy > 2 %}
  148.                         {% if category.Category.hierarchy == 3 %}
  149.                             {% set Cate3nd = category.Category %}
  150.                         {% endif %}
  151.                     {% endif %}
  152.                 {% endfor %}
  153.             {% endif %}
  154.         </p>
  155.         <!--▲ パンくず ▲-->
  156.         <!--▼ タイトル画像 ▼-->
  157.         {% if Cate2nd and Cate2nd.titleImagePath %}
  158.             <h1><a href="{{ url('product_list', {'cateid': Cate2nd.id}) }}"><img src="{{ Cate2nd.titleImagePath }}"></a></h1>
  159.         {% endif %}
  160.         <!--▲ タイトル画像 ▲-->
  161.         <!--▼ CONTENTS ▼-->
  162.         <div id="contents">
  163.             <table border="0" width="750" cellpadding="0" cellspacing="0" class="magazinebox">
  164.                 <tr>
  165.                     <td colspan="3"><div class="magtop1">&nbsp;</div></td>
  166.                 </tr>
  167.                 <tr>
  168.                     <td valign="top" style="width:230px; padding-right: 10px;">
  169.                         {% if Product.ProductImage|length > 1 %}
  170.                             <ul id="lightSlider">
  171.                                 {% for ProductImage in Product.ProductImage %}
  172.                                     <li data-thumb="{{ asset(ProductImage, 'save_image') }}"><img src="{{ asset(ProductImage, 'save_image') }}" style="width:100%;" /></li>
  173.                                 {% else %}
  174.                                     <li data-thumb="{{ asset(''|no_image_product, 'save_image') }}"><img src="{{ asset(''|no_image_product, 'save_image') }}" style="width:100%;" /></li>
  175.                                 {% endfor %}
  176.                             </ul>
  177.                         {% else %}
  178.                             {% set image = Product.ProductImage|first ?: ''|no_image_product %}
  179.                             <img src="{{ asset(image, 'save_image') }}" style="width:100%;" />
  180.                         {% endif %}
  181.                         <div class="mag_img_zoom">
  182.                             <!-- ▼ 拡大画像 ▼ -->
  183.                                 <a href="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}" data-lightbox="image-1" data-title="{{ Product.name }}" data-alt="{{ Product.name }}" style="font-size: 14.4px;" target="_blank">画像を拡大する</a>
  184.                             <!-- ▲ 拡大画像 ▲ -->
  185.                         </div>
  186.                     </td>
  187.                     <td valign="top" class="magbg" style="width:430px; padding-right: 10px; font-size: 120%;">
  188.                         <h3>
  189.                         {% if Product.linkurl %}
  190.                             <a href="{{ Product.linkurl }}">
  191.                         {% endif %}
  192.                                 <!-- ▼ 商品名 ▼ -->
  193.                                 <span class="style-title1" style="font-size:20px;">
  194.                                     {{ Product.name|raw|nl2br }}
  195.                                 </span>
  196.                                 <!-- ▲ 商品名 ▲ -->
  197.                         {% if Product.linkurl %}
  198.                             </a>
  199.                         {% endif %}
  200.                         </h3>
  201.                         {{ Product.comment1 }}<br>
  202.                         {{ Product.hatsubaibi }}<br>
  203.                         <!-- ▼ 商品コード ▼ -->
  204.                         {% if Product.code_min is not empty %}
  205.                             {{ Product.code_min }}{% if Product.code_min != Product.code_max %} ~ {{ Product.code_max }}{% endif %}<br>
  206.                         {% endif %}
  207.                         <!-- ▲ 商品コード ▲ -->
  208.                         <!-- ▼ 印刷物サイズ ▲ -->
  209.                         {{ Product.jissize }}<br>
  210.                         <!-- ▲ 印刷物サイズ ▲ -->
  211.                         {{ Product.teikaref }}
  212.                         <!-- ▼ 販売価格 ▼ -->
  213.                         {% if Product.hasProductClass %}
  214.                             {% if Product.getPrice02Min == Product.getPrice02Max %}
  215.                                 {{ Product.getPrice02IncTaxMin|number_format }}円(税込)<br>
  216.                             {% else %}
  217.                                 {{ Product.getPrice02IncTaxMin|number_format }} ~ {{ Product.getPrice02IncTaxMax|number_format }}円(税込)<br>
  218.                             {% endif %}
  219.                         {% else %}
  220.                             {{ Product.getPrice02IncTaxMin|number_format }}円(税込)<br>
  221.                         {% endif %}
  222.                         <!-- ▲ 販売価格 ▲ -->
  223.                         <!-- ▼ ISBNコード ▼ -->
  224.                         {% if Product.isbn %}
  225.                             ISBN:{{ Product.isbn }}<br>
  226.                         {% endif %}
  227.                         <!-- ▲ ISBNコード ▲ -->
  228.                         <form action="{{ url('product_add_cart', {id:Product.id}) }}" method="post" id="form1" name="form1">
  229.                             {% if Product.stock_find %}
  230.                                 <div class="ec-productRole__actions">
  231.                                     {% if form.classcategory_id1 is defined %}
  232.                                         <div class="ec-select">
  233.                                             {{ form_row(form.classcategory_id1) }}
  234.                                             {{ form_errors(form.classcategory_id1) }}
  235.                                         </div>
  236.                                         {% if form.classcategory_id2 is defined %}
  237.                                             <div class="ec-select">
  238.                                                 {{ form_row(form.classcategory_id2) }}
  239.                                                 {{ form_errors(form.classcategory_id2) }}
  240.                                             </div>
  241.                                         {% endif %}
  242.                                     {% endif %}
  243.                                     <div id="cart" class="mb10 mt40" style="display:none;">
  244.                                         <div class="mb10">
  245.                                             <span>数量:</span>
  246.                                             {{ form_widget(form.quantity, { attr : { style : "width:30px;"} }) }}
  247.                                             <a onclick="plus(document.getElementById('quantity')); return false">
  248.                                                 <img src="{{ asset('common_img/button/btn_plus.jpg', 'user_data') }}" width="21" height="21" alt="+">
  249.                                             </a>
  250.                                             <a onclick="minus(document.getElementById('quantity')); return false">
  251.                                                 <img src="{{ asset('common_img/button/btn_minus.jpg', 'user_data') }}" width="21" height="21" alt="-">
  252.                                             </a>
  253.                                             {{ form_errors(form.quantity) }}
  254.                                         </div>
  255.                                         <div class="mb10">
  256.                                             <button type="submit" class="hover_change_image"><img src="{{ asset('common_img/button/btn_cartin.jpg', 'user_data') }}"  alt="カートに入れる"></button>
  257.                                         </div>
  258.                                     </div>
  259.                                 </div>
  260.                             {% endif %}
  261.                             {{ form_rest(form) }}
  262.                         </form>
  263.                         <div id="sns" class="mag_sns" style="display: flex; margin-top:20px;">
  264.                             <div class="mag_fb">
  265.                                 <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">
  266.                                 </div>
  267.                             </div>
  268.                             <div class="mag_tweet">
  269.                                 <a href="#" class="twitter-share-button" data-lang="ja">ツイート</a>
  270.                                 <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>
  271.                             </div>
  272.                         </div>
  273.                     </td>
  274.                     <td id="cartbutton" width="250" valign="top" class="magbg">
  275.                         <!--▼ BTN ▼-->
  276.                         <ul class="mag_btnarea">
  277.                             {% if Product.amazon %}
  278.                                 <li class="mb10"><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>
  279.                             {% endif %}
  280.                             {% if Product.stock_find %}
  281.                                 {% if Cate3nd and Cate3nd.id not in [35, 46] %}
  282.                                     {% if Product.bookcart != 1 %}
  283.                                         <li class="mb10"><img src="{{ asset('common_img/bookcart_logo.gif', 'user_data') }}" alt="カート" onclick="cartmode();" style="cursor: pointer;"></li>
  284.                                     {% endif %}
  285.                                 {% endif %}
  286.                             {% else %}
  287.                                 {% if Cate3nd and Cate3nd.id not in [35, 46] %}
  288.                                     {% if Product.bookcart != 1 %}
  289.                                         <li class="mb10"><img src="{{ asset('common_img/zaikogire.gif', 'user_data') }}" alt="カート" onclick="cartmode();"></li>
  290.                                     {% endif %}
  291.                                 {% endif %}
  292.                             {% endif %}
  293.                             {% if Cate3nd and Cate3nd.id not in [49, 44, 75, 70, 57, 73] %}
  294.                                 {% if Cate3nd and Cate3nd.teikikoudoku1 > 0 %}
  295.                                     <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>
  296.                                 {% endif %}
  297.                                 {% if Cate3nd and Cate3nd.teikikoudoku2 > 0 %}
  298.                                     <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>
  299.                                 {% endif %}
  300.                             {% endif %}
  301.                         </ul>
  302.                         <!--▲ BTN ▲-->
  303.                     </td>
  304.                 </tr>
  305.             </table>
  306.             <table id="description" border="0" width="810" cellpadding="0" cellspacing="0" class="magazinebox" style="font-size: 120%;">
  307.                 <tr>
  308.                     <td>
  309.                         {% if sportscard != 1 %}
  310.                             <div><h3>CONTENTS</h3></div>
  311.                         {% else %}
  312.                             <style>
  313.                                 h2 {
  314.                                     width: 730px;
  315.                                     padding: 7px 10px 0;
  316.                                     background: #b9dded;
  317.                                     box-shadow: 3px 2px 4px 0 #8fbcd8;
  318.                                     margin: 0 0 8px;
  319.                                     font-size: 110%;
  320.                                     height: 25px;
  321.                                     color: #154766;
  322.                                     line-height: 100%;
  323.                                 }
  324.                             </style>
  325.                         {% endif %}
  326.                         <div class="magbottom1" style="width: 730px;">{{ Product.description_detail|raw }}</div>
  327.                     </td>
  328.                 </tr>
  329.             </table>
  330.     {% if RecommendList %}
  331.             <!--▼おすすめ商品-->
  332.             <h2 class="mb30">おすすめ商品</h2>
  333.               <ul class="mag_list clearfix">
  334.                 <!--▼ ARTICLE ▼-->
  335.                 {% for Recommend in RecommendList %}
  336.                     <li>
  337.                         <a href="{{ url('product_detail', {'id': Recommend.id}) }}">
  338.                             <div class="mag_img">
  339.                                 <img src="{{ asset(Recommend.main_list_image|no_image_product, 'save_image') }}" alt="{{ Recommend.name }}" />
  340.                                 <div class="mag_txt">
  341.                                     <h4>{{ Recommend.name }}</h4>
  342.                                     <!-- ▼ 販売価格 ▼ -->
  343.                                     {% if Recommend.hasProductClass %}
  344.                                         {% if Recommend.getPrice02Min == Recommend.getPrice02Max %}
  345.                                             {{ Recommend.getPrice02IncTaxMin|number_format }}円(税込)
  346.                                         {% else %}
  347.                                             {{ Recommend.getPrice02IncTaxMin|number_format }} ~ {{ Recommend.getPrice02IncTaxMax|number_format }}円(税込)
  348.                                         {% endif %}
  349.                                     {% else %}
  350.                                         {{ Recommend.getPrice02IncTaxMin|number_format }}円(税込)
  351.                                     {% endif %}
  352.                                     <!-- ▲ 販売価格 ▲ -->
  353.                                 </div>
  354.                             </div>
  355.                         </a>
  356.                     </li>
  357.                 {% endfor %}
  358.                 <!--▲ ARTICLE ▲-->
  359.             </ul>
  360.             <!--▲おすすめ商品-->
  361.     {% endif %}
  362.         </div>
  363.         <!--▲ CONTENTS ▲-->
  364.         <!--▼ NAV ▼-->
  365.         <div id="snav">
  366.             <ul class="sbnr">
  367.                 {% if Banners %}
  368.                     {% for Banner in Banners %}
  369.                         {% for cnt in 1..30 %}
  370.                             {% set cntdsp = '%02d'|format(cnt) %}
  371.                             {% set image = Banner['image'~cntdsp] %}
  372.                             {% set link = Banner['link'~cntdsp] %}
  373.                             {% set blank = Banner['blank'~cntdsp] %}
  374.                             {% if image %}
  375.                                 {% if blank == 1 %}
  376.                                     {% set dspBlank = 'target="_blank"' %}
  377.                                 {% else %}
  378.                                     {% set dspBlank = '' %}
  379.                                 {% endif %}
  380.                                 <li>
  381.                                     <a href="{{ link }}" {{ dspBlank }}><img src="{{ asset('', 'save_image') }}/visual_{{ Banner.id }}/{{ image }}" width="240"></a>
  382.                                 </li>
  383.                             {% endif %}
  384.                         {% endfor %}
  385.                     {% endfor %}
  386.                 {% endif %}
  387.             </ul>
  388.         </div>
  389.         <!--▲ NAV ▲-->
  390.     </div>
  391.     <!--▲ CONTAINER ▲-->
  392.     <!--▼ GNAVI2 メインメニュ右 ▼-->
  393.     <div id="gnavi2" class="panel">
  394.         <div id="gnavi2_contents" class="clearfix">
  395.         {% if Cate2nd %}
  396.             {% for child_category in Cate2nd.children|reverse %}
  397.                 {% if loop.index0 % 7 == 0 %}
  398.                     {% if not loop.first %}
  399.                         </ul>
  400.                     {% endif %}
  401.                     <ul class="gnavi2_ul mr40">
  402.                 {% endif %}
  403.                 <li><a href="{{ path('product_list', {cateid: child_category.id}) }}">{{ child_category.name }}</a></li>
  404.                 {% if loop.last %}
  405.                     </ul>
  406.                 {% endif %}
  407.             {% endfor %}
  408.         {% endif %}
  409.         </div>
  410.     </div>
  411.     <!--▲ GNAVI02 メインメニュ右 ▲-->
  412. {% else %}
  413.     <!--A-FORM ランディングページのとき-->
  414.     <div id="container" class="w1000">
  415.         <div id="content" class="w810">
  416.             <div id="contentbox">
  417.                 {{ Product.description_detail|raw }}
  418.             </div>
  419.         </div>
  420.     </div>
  421. {% endif %}
  422. {# ▼ ブロック:DispFooter ▼ #}
  423. {{ include('Block/DispFooter.twig') }}
  424. {# ▲ ブロック:DispFooter ▲ #}
  425. {# ▼ ブロック:DispFtag ▼ #}
  426. {{ include('Block/DispFtag.twig') }}
  427. {# ▲ ブロック:DispFtag ▲ #}
  428. </body>
  429. </html>
  430. {% endblock %}
  431. {# ▲ main ▲ #}