var/cache/dev/twig/f3/f3dfe0305c3bbed574f18ad5ce75a5f2.php line 35

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* Block/cart.twig */
  14. class __TwigTemplate_0aa8f44d329e224e4b2fe8177eca026d extends \Eccube\Twig\Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->parent false;
  23.         $this->blocks = [
  24.         ];
  25.         $this->sandbox $this->env->getExtension('\Twig\Extension\SandboxExtension');
  26.         $this->checkSecurity();
  27.     }
  28.     protected function doDisplay(array $context, array $blocks = [])
  29.     {
  30.         $macros $this->macros;
  31.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  32.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""Block/cart.twig"));
  33.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  34.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""Block/cart.twig"));
  35.         // line 11
  36.         $context["Carts"] = $this->extensions['Eccube\Twig\Extension\CartServiceExtension']->get_all_carts();
  37.         // line 12
  38.         $context["totalPrice"] = $this->extensions['Eccube\Twig\Extension\CartServiceExtension']->get_carts_total_price();
  39.         // line 13
  40.         $context["totalQuantity"] = $this->extensions['Eccube\Twig\Extension\CartServiceExtension']->get_carts_total_quantity();
  41.         // line 14
  42.         echo "<div class=\"ec-cartNaviWrap\">
  43. \t<div class=\"header-cart\">
  44. \t\t<a href=\"";
  45.         // line 16
  46.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("cart");
  47.         echo "\">
  48. \t\t\t<div class=\"header-cart-icon\">
  49. \t\t\t\t<img src=\"";
  50.         // line 18
  51.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/common/icon-cart.svg""user_data"), "html"nulltrue);
  52.         echo "\" alt=\"\">
  53. \t\t\t<span class=\"header-cart-badge\">";
  54.         // line 19
  55.         echo twig_escape_filter($this->envtwig_number_format_filter($this->env$this->sandbox->ensureToStringAllowed((isset($context["totalQuantity"]) || array_key_exists("totalQuantity"$context) ? $context["totalQuantity"] : (function () { throw new RuntimeError('Variable "totalQuantity" does not exist.'19$this->source); })()), 19$this->source)), "html"nulltrue);
  56.         echo "</span>
  57. \t\t\t</div>
  58. \t\t\t<span class=\"header-item-name\">";
  59.         // line 21
  60.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カート"), "html"nulltrue);
  61.         echo "</span>
  62. \t\t\t";
  63.         // line 25
  64.         echo "\t\t</a>
  65. \t</div>
  66. \t";
  67.         // line 27
  68.         if (((isset($context["totalQuantity"]) || array_key_exists("totalQuantity"$context) ? $context["totalQuantity"] : (function () { throw new RuntimeError('Variable "totalQuantity" does not exist.'27$this->source); })()) > 0)) {
  69.             // line 28
  70.             echo "\t\t<div class=\"ec-cartNaviIsset\">
  71. \t\t\t";
  72.             // line 29
  73.             $context['_parent'] = $context;
  74.             $context['_seq'] = twig_ensure_traversable((isset($context["Carts"]) || array_key_exists("Carts"$context) ? $context["Carts"] : (function () { throw new RuntimeError('Variable "Carts" does not exist.'29$this->source); })()));
  75.             foreach ($context['_seq'] as $context["_key"] => $context["Cart"]) {
  76.                 // line 30
  77.                 echo "\t\t\t\t";
  78.                 $context['_parent'] = $context;
  79.                 $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source$context["Cart"], "CartItems", [], "any"falsefalsetrue30));
  80.                 foreach ($context['_seq'] as $context["_key"] => $context["CartItem"]) {
  81.                     // line 31
  82.                     echo "\t\t\t\t\t";
  83.                     $context["ProductClass"] = twig_get_attribute($this->env$this->source$context["CartItem"], "ProductClass", [], "any"falsefalsetrue31);
  84.                     // line 32
  85.                     echo "\t\t\t\t\t";
  86.                     $context["Product"] = twig_get_attribute($this->env$this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass"$context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.'32$this->source); })()), "Product", [], "any"falsefalsetrue32);
  87.                     // line 33
  88.                     echo "\t\t\t\t\t<div class=\"ec-cartNaviIsset__cart\">
  89. \t\t\t\t\t\t<div class=\"ec-cartNaviIsset__cartImage\">
  90. \t\t\t\t\t\t\t<img src=\"";
  91.                     // line 35
  92.                     echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source, (isset($context["Product"]) || array_key_exists("Product"$context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.'35$this->source); })()), "MainListImage", [], "any"falsefalsetrue35), 35$this->source)), "save_image"), "html"nulltrue);
  93.                     echo "\" alt=\"";
  94.                     echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source, (isset($context["Product"]) || array_key_exists("Product"$context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.'35$this->source); })()), "name", [], "any"falsefalsetrue35), 35$this->source), "html"nulltrue);
  95.                     echo "\">
  96. \t\t\t\t\t\t</div>
  97. \t\t\t\t\t\t<div class=\"ec-cartNaviIsset__cartContent\">
  98. \t\t\t\t\t\t\t<div class=\"ec-cartNaviIsset__cartContentTitle\">";
  99.                     // line 38
  100.                     echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source, (isset($context["Product"]) || array_key_exists("Product"$context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.'38$this->source); })()), "name", [], "any"falsefalsetrue38), 38$this->source), "html"nulltrue);
  101.                     echo "
  102. \t\t\t\t\t\t\t\t<div class=\"ec-font-size-1\">
  103. \t\t\t\t\t\t\t\t\t";
  104.                     // line 40
  105.                     if ((twig_get_attribute($this->env$this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass"$context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.'40$this->source); })()), "ClassCategory1", [], "any"falsefalsetrue40) && twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass"$context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.'40$this->source); })()), "ClassCategory1", [], "any"falsefalsetrue40), "id", [], "any"falsefalsetrue40))) {
  106.                         // line 41
  107.                         echo "\t\t\t\t\t\t\t\t\t\t";
  108.                         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass"$context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.'41$this->source); })()), "ClassCategory1", [], "any"falsefalsetrue41), "ClassName", [], "any"falsefalsetrue41), "name", [], "any"falsefalsetrue41), 41$this->source), "html"nulltrue);
  109.                         echo ":";
  110.                         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass"$context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.'41$this->source); })()), "ClassCategory1", [], "any"falsefalsetrue41), 41$this->source), "html"nulltrue);
  111.                         echo "
  112. \t\t\t\t\t\t\t\t\t";
  113.                     }
  114.                     // line 43
  115.                     echo "\t\t\t\t\t\t\t\t\t";
  116.                     if ((twig_get_attribute($this->env$this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass"$context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.'43$this->source); })()), "ClassCategory2", [], "any"falsefalsetrue43) && twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass"$context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.'43$this->source); })()), "ClassCategory2", [], "any"falsefalsetrue43), "id", [], "any"falsefalsetrue43))) {
  117.                         // line 44
  118.                         echo "\t\t\t\t\t\t\t\t\t\t<br>";
  119.                         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass"$context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.'44$this->source); })()), "ClassCategory2", [], "any"falsefalsetrue44), "ClassName", [], "any"falsefalsetrue44), "name", [], "any"falsefalsetrue44), 44$this->source), "html"nulltrue);
  120.                         echo ":";
  121.                         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass"$context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.'44$this->source); })()), "ClassCategory2", [], "any"falsefalsetrue44), 44$this->source), "html"nulltrue);
  122.                         echo "
  123. \t\t\t\t\t\t\t\t\t";
  124.                     }
  125.                     // line 46
  126.                     echo "\t\t\t\t\t\t\t\t</div>
  127. \t\t\t\t\t\t\t</div>
  128. \t\t\t\t\t\t\t<div class=\"ec-cartNaviIsset__cartContentPrice\">
  129. \t\t\t\t\t\t\t\t";
  130.                     // line 49
  131.                     echo twig_escape_filter($this->env$this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["CartItem"], "price", [], "any"falsefalsetrue49), 49$this->source)), "html"nulltrue);
  132.                     echo "
  133. \t\t\t\t\t\t\t\t<div class=\"ec-cartNaviIsset__cartContentTax\">";
  134.                     // line 50
  135.                     echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("税込"), "html"nulltrue);
  136.                     echo "</div>
  137. \t\t\t\t\t\t\t</div>
  138. \t\t\t\t\t\t\t<div class=\"ec-cartNaviIsset__cartContentNumber\">";
  139.                     // line 52
  140.                     echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("数量"), "html"nulltrue);
  141.                     echo "
  142. \t\t\t\t\t\t\t\t";
  143.                     // line 53
  144.                     echo twig_escape_filter($this->envtwig_number_format_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["CartItem"], "quantity", [], "any"falsefalsetrue53), 53$this->source)), "html"nulltrue);
  145.                     echo "</div>
  146. \t\t\t\t\t\t</div>
  147. \t\t\t\t\t</div>
  148. \t\t\t\t";
  149.                 }
  150.                 $_parent $context['_parent'];
  151.                 unset($context['_seq'], $context['_iterated'], $context['_key'], $context['CartItem'], $context['_parent'], $context['loop']);
  152.                 $context array_intersect_key($context$_parent) + $_parent;
  153.                 // line 57
  154.                 echo "\t\t\t";
  155.             }
  156.             $_parent $context['_parent'];
  157.             unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Cart'], $context['_parent'], $context['loop']);
  158.             $context array_intersect_key($context$_parent) + $_parent;
  159.             // line 58
  160.             echo "\t\t\t<div class=\"ec-cartNaviIsset__action\">
  161. \t\t\t\t<a class=\"ec-blockBtn--action\" href=\"";
  162.             // line 59
  163.             echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("cart");
  164.             echo "\">";
  165.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートへ進む"), "html"nulltrue);
  166.             echo "</a>
  167. \t\t\t\t<a class=\"ec-blockBtn ec-cartNavi--cancel\">";
  168.             // line 60
  169.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("キャンセル"), "html"nulltrue);
  170.             echo "</a>
  171. \t\t\t</div>
  172. \t\t</div>
  173. \t";
  174.         } else {
  175.             // line 64
  176.             echo "\t\t<div class=\"ec-cartNaviNull\">
  177. \t\t\t<div class=\"ec-cartNaviNull__message\">
  178. \t\t\t\t<p>";
  179.             // line 66
  180.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("現在カート内に商品はございません。"), "html"nulltrue);
  181.             echo "</p>
  182. \t\t\t</div>
  183. \t\t</div>
  184. \t";
  185.         }
  186.         // line 70
  187.         echo "</div>
  188. ";
  189.         
  190.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  191.         
  192.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  193.     }
  194.     public function getTemplateName()
  195.     {
  196.         return "Block/cart.twig";
  197.     }
  198.     public function isTraitable()
  199.     {
  200.         return false;
  201.     }
  202.     public function getDebugInfo()
  203.     {
  204.         return array (  196 => 70,  189 => 66,  185 => 64,  178 => 60,  172 => 59,  169 => 58,  163 => 57,  153 => 53,  149 => 52,  144 => 50,  140 => 49,  135 => 46,  127 => 44,  124 => 43,  116 => 41,  114 => 40,  109 => 38,  101 => 35,  97 => 33,  94 => 32,  91 => 31,  86 => 30,  82 => 29,  79 => 28,  77 => 27,  73 => 25,  69 => 21,  64 => 19,  60 => 18,  55 => 16,  51 => 14,  49 => 13,  47 => 12,  45 => 11,);
  205.     }
  206.     public function getSourceContext()
  207.     {
  208.         return new Source("{#
  209. This file is part of EC-CUBE
  210. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  211. http://www.ec-cube.co.jp/
  212. For the full copyright and license information, please view the LICENSE
  213. file that was distributed with this source code.
  214. #}
  215. {% set Carts = get_all_carts() %}
  216. {% set totalPrice = get_carts_total_price() %}
  217. {% set totalQuantity = get_carts_total_quantity() %}
  218. <div class=\"ec-cartNaviWrap\">
  219. \t<div class=\"header-cart\">
  220. \t\t<a href=\"{{ url('cart') }}\">
  221. \t\t\t<div class=\"header-cart-icon\">
  222. \t\t\t\t<img src=\"{{ asset('assets/img/common/icon-cart.svg', 'user_data') }}\" alt=\"\">
  223. \t\t\t<span class=\"header-cart-badge\">{{ totalQuantity|number_format }}</span>
  224. \t\t\t</div>
  225. \t\t\t<span class=\"header-item-name\">{{ 'カート'|trans }}</span>
  226. \t\t\t{# <div class=\"ec-cartNavi__label\">
  227. \t\t\t\t\t<div class=\"ec-cartNavi__price\">{{ totalPrice|price }}</div>
  228. \t\t\t\t</div> #}
  229. \t\t</a>
  230. \t</div>
  231. \t{% if totalQuantity > 0 %}
  232. \t\t<div class=\"ec-cartNaviIsset\">
  233. \t\t\t{% for Cart in Carts %}
  234. \t\t\t\t{% for CartItem in Cart.CartItems %}
  235. \t\t\t\t\t{% set ProductClass = CartItem.ProductClass %}
  236. \t\t\t\t\t{% set Product = ProductClass.Product %}
  237. \t\t\t\t\t<div class=\"ec-cartNaviIsset__cart\">
  238. \t\t\t\t\t\t<div class=\"ec-cartNaviIsset__cartImage\">
  239. \t\t\t\t\t\t\t<img src=\"{{ asset(Product.MainListImage|no_image_product, 'save_image') }}\" alt=\"{{ Product.name }}\">
  240. \t\t\t\t\t\t</div>
  241. \t\t\t\t\t\t<div class=\"ec-cartNaviIsset__cartContent\">
  242. \t\t\t\t\t\t\t<div class=\"ec-cartNaviIsset__cartContentTitle\">{{ Product.name }}
  243. \t\t\t\t\t\t\t\t<div class=\"ec-font-size-1\">
  244. \t\t\t\t\t\t\t\t\t{% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
  245. \t\t\t\t\t\t\t\t\t\t{{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}
  246. \t\t\t\t\t\t\t\t\t{% endif %}
  247. \t\t\t\t\t\t\t\t\t{% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
  248. \t\t\t\t\t\t\t\t\t\t<br>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}
  249. \t\t\t\t\t\t\t\t\t{% endif %}
  250. \t\t\t\t\t\t\t\t</div>
  251. \t\t\t\t\t\t\t</div>
  252. \t\t\t\t\t\t\t<div class=\"ec-cartNaviIsset__cartContentPrice\">
  253. \t\t\t\t\t\t\t\t{{ CartItem.price|price }}
  254. \t\t\t\t\t\t\t\t<div class=\"ec-cartNaviIsset__cartContentTax\">{{ '税込'|trans }}</div>
  255. \t\t\t\t\t\t\t</div>
  256. \t\t\t\t\t\t\t<div class=\"ec-cartNaviIsset__cartContentNumber\">{{ '数量'|trans }}
  257. \t\t\t\t\t\t\t\t{{ CartItem.quantity|number_format }}</div>
  258. \t\t\t\t\t\t</div>
  259. \t\t\t\t\t</div>
  260. \t\t\t\t{% endfor %}
  261. \t\t\t{% endfor %}
  262. \t\t\t<div class=\"ec-cartNaviIsset__action\">
  263. \t\t\t\t<a class=\"ec-blockBtn--action\" href=\"{{ url('cart') }}\">{{ 'カートへ進む'|trans }}</a>
  264. \t\t\t\t<a class=\"ec-blockBtn ec-cartNavi--cancel\">{{ 'キャンセル'|trans }}</a>
  265. \t\t\t</div>
  266. \t\t</div>
  267. \t{% else %}
  268. \t\t<div class=\"ec-cartNaviNull\">
  269. \t\t\t<div class=\"ec-cartNaviNull__message\">
  270. \t\t\t\t<p>{{ '現在カート内に商品はございません。'|trans }}</p>
  271. \t\t\t</div>
  272. \t\t</div>
  273. \t{% endif %}
  274. </div>
  275. ""Block/cart.twig""/home/hirota-s.com/public_html/app/template/default/Block/cart.twig");
  276.     }
  277.     
  278.     public function checkSecurity()
  279.     {
  280.         static $tags = array("set" => 11"if" => 27"for" => 29);
  281.         static $filters = array("escape" => 18"number_format" => 19"trans" => 21"no_image_product" => 35"price" => 49);
  282.         static $functions = array("get_all_carts" => 11"get_carts_total_price" => 12"get_carts_total_quantity" => 13"url" => 16"asset" => 18);
  283.         try {
  284.             $this->sandbox->checkSecurity(
  285.                 ['set''if''for'],
  286.                 ['escape''number_format''trans''no_image_product''price'],
  287.                 ['get_all_carts''get_carts_total_price''get_carts_total_quantity''url''asset']
  288.             );
  289.         } catch (SecurityError $e) {
  290.             $e->setSourceContext($this->source);
  291.             if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
  292.                 $e->setTemplateLine($tags[$e->getTagName()]);
  293.             } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
  294.                 $e->setTemplateLine($filters[$e->getFilterName()]);
  295.             } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
  296.                 $e->setTemplateLine($functions[$e->getFunctionName()]);
  297.             }
  298.             throw $e;
  299.         }
  300.     }
  301. }