app/template/osechi/ProductReview42/Resource/template/default/review.twig line 1

Open in your IDE?
  1. {#
  2. /*
  3.  * This file is part of the ProductReview plugin
  4.  *
  5.  * Copyright (C) 2016 LOCKON CO.,LTD. All Rights Reserved.
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. #}
  11. {#
  12. ///////////////////////////////////////////////////////////////////////
  13. This template is part of EC-CUBE Design template.
  14. Copyright(c) JAPAN ELECTRONIC INDUSTRIAL ARTS CO.LTD.
  15. http://www.jeia.co.jp/
  16. For the full copyright and license information, please view the LICENSE
  17. file that was distributed with this source code.
  18. 本テンプレートの著作権は、「株式会社日本電子工藝社」に帰属いたします。
  19. ※本テンプレートを譲渡・再頒布・転用・第三者へ開示することは禁止いたします。
  20. ただし、事業者によるショップ運営者への設置代行を禁止するものではございません。
  21. ※本テンプレートを申請されたご利用サイトへの設置以外の目的で複製することは禁止いたします。
  22. ※本テンプレートデータ内のライセンス条項、および著作権に関する記述を削除することはできません。
  23. ※ご利用サイトを変更することはできません。申請と異なるサイトにてご利用になる場合は、
  24. 別途、ご利用費用をお支払いただく必要がございます。
  25. ※本テンプレートの改変にあたり、一切のサポートはいたしかねます。
  26. ※本テンプレートは、すべての設置環境で動作する事は保証しておりません。
  27. ///////////////////////////////////////////////////////////////////////
  28. #}
  29. {% import _self as stars %}
  30. {# 星テキスト生成用マクロ #}
  31. {% macro stars(positive, negative) %}
  32.     {% set positive_stars = ["", "★", "★★", "★★★", "★★★★", "★★★★★"] %}
  33.     {% set negative_stars = ["", "☆", "☆☆", "☆☆☆", "☆☆☆☆", "☆☆☆☆☆"] %}
  34.     {{ positive_stars[positive] }}{{ negative_stars[negative] }}
  35. {% endmacro %}
  36. <script>
  37.     $(function() {
  38.         // 商品レビューブロック
  39.         var $productReviewRole = $( '#product_review_area' );
  40.         // 商品詳細ページに挿入
  41.         $productReviewRole.appendTo( $('.ec-layoutRole__main, .ec-layoutRole__mainWithColumn, .ec-layoutRole__mainBetweenColumn') );
  42.         var $content = $productReviewRole.find( '.ec-productReviewRole__content' );
  43.         var $toggle =  $productReviewRole.find( '.toggle' );
  44.         $toggle.on('click', function(){
  45.             // レビューコンテンツ枠開閉
  46.             $content.slideToggle();
  47.             // トグルボタン開閉状態class
  48.             $toggle.toggleClass( 'is-close' );
  49.         });
  50.     });
  51. </script>
  52. <!-- ▼商品レビュー -->
  53. <!-- ▲商品レビュー -->