<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* __string_template__a8622c249d6509d1e837099f3f6022f6 */
class __TwigTemplate_9f0421b3b6a4d25f9f254fa965a0da52 extends \Eccube\Twig\Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
$this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension');
$this->checkSecurity();
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "__string_template__a8622c249d6509d1e837099f3f6022f6"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "__string_template__a8622c249d6509d1e837099f3f6022f6"));
// line 7
echo "<div class=\"ec-headerTopBar\">
<div class=\"ec-headerTopBar__inner\">
<div class=\"ec-headerTopBar__left\">
<button type=\"button\" class=\"ec-headerTopBar__messagePrev\" aria-label=\"";
// line 10
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("前のメッセージ"), "html", null, true);
echo "\"><</button>
<div class=\"ec-headerTopBar__message\" data-current=\"1\">
<span class=\"ec-headerTopBar__messageItem ec-headerTopBar__messageItem--1\"><i class=\"fas fa-truck\"></i> 33,000 円(税込)以上のご注文で送料無料(国内配送・一部地域を除く)</span>
<span class=\"ec-headerTopBar__messageItem ec-headerTopBar__messageItem--2\">Complimentary domestic shipping on orders over ¥33,000.*</span>
</div>
<button type=\"button\" class=\"ec-headerTopBar__messageNext\" aria-label=\"";
// line 15
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("次のメッセージ"), "html", null, true);
echo "\">></button>
</div>
</div>
</div>
";
// line 20
echo "<div class=\"ec-headerSearchWrap is-pc\" style=\"display:none;\">
";
// line 21
echo $this->env->getRuntime('Symfony\Bridge\Twig\Extension\HttpKernelRuntime')->renderFragment($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("block_search_product"));
echo "
</div>
";
// line 24
echo "<div class=\"ec-headerMain\">
<div class=\"ec-headerMain__inner\">
<div class=\"ec-headerMain__left\">
<a href=\"#\" class=\"ec-headerMain__searchToggle ec-headerTopBar__searchToggle\" aria-label=\"";
// line 27
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("検索"), "html", null, true);
echo "\"><i class=\"fas fa-search\"></i></a>
</div>
<div class=\"ec-headerMain__centerLogo\">
";
// line 30
echo $this->extensions['Eccube\Twig\Extension\IgnoreTwigSandboxErrorExtension']->twig_include($this->env, $context, "Block/logo.twig");
echo "
</div>
<div class=\"ec-headerMain__right\">
<div class=\"ec-headerMain__account\">";
// line 33
if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_USER")) {
echo "<a href=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("mypage");
echo "\" aria-label=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("マイページ"), "html", null, true);
echo "\"><i class=\"fas fa-user\"></i></a>";
} else {
echo "<a href=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("mypage_login");
echo "\" aria-label=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ログイン"), "html", null, true);
echo "\"><i class=\"fas fa-user\"></i></a>";
}
echo "</div>
<div class=\"ec-headerMain__favorite\"><a href=\"";
// line 34
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("mypage_favorite");
echo "\" aria-label=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お気に入り"), "html", null, true);
echo "\"><i class=\"far fa-heart\"></i></a></div>
<div class=\"ec-headerRole__cart\">
";
// line 46
$context["Carts"] = $this->extensions['Eccube\Twig\Extension\CartServiceExtension']->get_all_carts();
// line 47
$context["totalPrice"] = $this->extensions['Eccube\Twig\Extension\CartServiceExtension']->get_carts_total_price();
// line 48
$context["totalQuantity"] = $this->extensions['Eccube\Twig\Extension\CartServiceExtension']->get_carts_total_quantity();
// line 49
echo "<div class=\"ec-cartNaviWrap\">
<div class=\"ec-cartNavi\">
<div class=\"ec-cartNavi__div\">
<img src=\"";
// line 52
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/icon/icon_cart.svg"), "html", null, true);
echo "\" alt=\"\">
<br>
<span class=\"ec-cartNavi__badge\">";
// line 54
echo twig_escape_filter($this->env, twig_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.', 54, $this->source); })()), 54, $this->source)), "html", null, true);
echo "</span>
</div>
<div class=\"ec-cartNavi__label\">
<div class=\"ec-cartNavi__price\">TOTAL<br>";
// line 57
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed((isset($context["totalPrice"]) || array_key_exists("totalPrice", $context) ? $context["totalPrice"] : (function () { throw new RuntimeError('Variable "totalPrice" does not exist.', 57, $this->source); })()), 57, $this->source)), "html", null, true);
echo "</div>
</div>
</div>
";
// line 60
if (((isset($context["totalQuantity"]) || array_key_exists("totalQuantity", $context) ? $context["totalQuantity"] : (function () { throw new RuntimeError('Variable "totalQuantity" does not exist.', 60, $this->source); })()) > 0)) {
// line 61
echo " <div class=\"ec-cartNaviIsset\">
";
// line 62
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["Carts"]) || array_key_exists("Carts", $context) ? $context["Carts"] : (function () { throw new RuntimeError('Variable "Carts" does not exist.', 62, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["Cart"]) {
// line 63
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["Cart"], "CartItems", [], "any", false, false, true, 63));
foreach ($context['_seq'] as $context["_key"] => $context["CartItem"]) {
// line 64
echo " ";
$context["ProductClass"] = twig_get_attribute($this->env, $this->source, $context["CartItem"], "ProductClass", [], "any", false, false, true, 64);
// line 65
echo " ";
$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.', 65, $this->source); })()), "Product", [], "any", false, false, true, 65);
// line 66
echo " <div class=\"ec-cartNaviIsset__cart\">
<div class=\"ec-cartNaviIsset__cartImage\">
<img src=\"";
// line 68
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct($this->extensions['Plugin\ApgProductClassImage42\Twig\Extension\PluginExtension']->getClassImage($this->sandbox->ensureToStringAllowed((isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 68, $this->source); })()), 68, $this->source), $this->sandbox->ensureToStringAllowed((isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 68, $this->source); })()), 68, $this->source))), "save_image"), "html", null, true);
echo "\" alt=\"";
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.', 68, $this->source); })()), "name", [], "any", false, false, true, 68), 68, $this->source), "html", null, true);
echo "\"/>
</div>
<div class=\"ec-cartNaviIsset__cartContent\">
<div class=\"ec-cartNaviIsset__cartContentTitle\">";
// line 71
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.', 71, $this->source); })()), "name", [], "any", false, false, true, 71), 71, $this->source), "html", null, true);
echo "
<div class=\"ec-font-size-1\">
";
// line 73
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.', 73, $this->source); })()), "ClassCategory1", [], "any", false, false, true, 73) && twig_get_attribute($this->env, $this->source, 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.', 73, $this->source); })()), "ClassCategory1", [], "any", false, false, true, 73), "id", [], "any", false, false, true, 73))) {
// line 74
echo " ";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, 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.', 74, $this->source); })()), "ClassCategory1", [], "any", false, false, true, 74), "ClassName", [], "any", false, false, true, 74), "name", [], "any", false, false, true, 74), 74, $this->source), "html", null, true);
echo ":";
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.', 74, $this->source); })()), "ClassCategory1", [], "any", false, false, true, 74), 74, $this->source), "html", null, true);
echo "
";
}
// line 76
echo " ";
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.', 76, $this->source); })()), "ClassCategory2", [], "any", false, false, true, 76) && twig_get_attribute($this->env, $this->source, 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.', 76, $this->source); })()), "ClassCategory2", [], "any", false, false, true, 76), "id", [], "any", false, false, true, 76))) {
// line 77
echo " <br>";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, 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.', 77, $this->source); })()), "ClassCategory2", [], "any", false, false, true, 77), "ClassName", [], "any", false, false, true, 77), "name", [], "any", false, false, true, 77), 77, $this->source), "html", null, true);
echo ":";
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.', 77, $this->source); })()), "ClassCategory2", [], "any", false, false, true, 77), 77, $this->source), "html", null, true);
echo "
";
}
// line 79
echo " </div>
</div>
<div class=\"ec-cartNaviIsset__cartContentPrice\">
";
// line 82
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", false, false, true, 82), 82, $this->source)), "html", null, true);
echo "
<div class=\"ec-cartNaviIsset__cartContentTax\">";
// line 83
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("税込"), "html", null, true);
echo "</div>
</div>
<div class=\"ec-cartNaviIsset__cartContentNumber\">";
// line 85
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("数量"), "html", null, true);
echo " ";
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["CartItem"], "quantity", [], "any", false, false, true, 85), 85, $this->source)), "html", null, true);
echo "</div>
</div>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['CartItem'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 89
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Cart'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 90
echo " <div class=\"ec-cartNaviIsset__action\">
<a class=\"ec-blockBtn--action\" href=\"";
// line 91
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("cart");
echo "\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートへ進む"), "html", null, true);
echo "</a>
<a class=\"ec-blockBtn ec-cartNavi--cancel\">";
// line 92
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("キャンセル"), "html", null, true);
echo "</a>
</div>
</div>
";
} else {
// line 96
echo " <div class=\"ec-cartNaviNull\">
<div class=\"ec-cartNaviNull__message\">
<p>";
// line 98
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("現在カート内に商品はございません。"), "html", null, true);
echo "</p>
</div>
</div>
";
}
// line 102
echo "</div>
</div>
</div>
<div class=\"ec-headerRole__navSP is-sp\">
";
// line 107
echo $this->extensions['Eccube\Twig\Extension\IgnoreTwigSandboxErrorExtension']->twig_include($this->env, $context, "Block/nav_sp.twig");
echo "
</div>
</div>
</div>
";
// line 112
echo $this->extensions['Eccube\Twig\Extension\IgnoreTwigSandboxErrorExtension']->twig_include($this->env, $context, "Block/mega_menu_modal.twig");
echo "
";
// line 114
echo "<div class=\"ec-search is-sp\" id=\"ec-search-sp\" style=\"display:none;\">
";
// line 115
echo $this->env->getRuntime('Symfony\Bridge\Twig\Extension\HttpKernelRuntime')->renderFragment($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("block_search_product", ["mode" => "keyword_only"]));
echo "
</div>
<script>
(function() {
document.addEventListener('DOMContentLoaded', function() {
var t = document.querySelector('.ec-headerTopBar__searchToggle');
var w = document.querySelector('.ec-headerSearchWrap');
var spSearch = document.getElementById('ec-search-sp');
if (t) {
t.addEventListener('click', function(e) {
e.preventDefault();
if (w) w.style.display = w.style.display === 'none' ? 'block' : 'none';
if (spSearch) spSearch.style.display = spSearch.style.display === 'none' ? 'block' : 'none';
});
}
(function messageSlider() {
var el = document.querySelector('.ec-headerTopBar__message');
var prev = document.querySelector('.ec-headerTopBar__messagePrev');
var next = document.querySelector('.ec-headerTopBar__messageNext');
if (!el || !prev || !next) return;
var current = 1;
var total = 2;
var intervalId = null;
var duration = 5000;
function show(n) {
current = (n - 1 + total) % total + 1;
el.setAttribute('data-current', String(current));
}
function goNext() {
show(current === 1 ? 2 : 1);
resetTimer();
}
function goPrev() {
show(current === 2 ? 1 : 2);
resetTimer();
}
function resetTimer() {
if (intervalId) clearInterval(intervalId);
intervalId = setInterval(goNext, duration);
}
prev.addEventListener('click', function(e) { e.preventDefault(); goPrev(); });
next.addEventListener('click', function(e) { e.preventDefault(); goNext(); });
intervalId = setInterval(goNext, duration);
})();
var modal = document.getElementById('mega-menu-modal');
var trigger = document.querySelector('.mega-menu__trigger[data-mega-open]');
var closers = document.querySelectorAll('[data-mega-close]');
if (trigger) {
trigger.addEventListener('click', function(e) {
e.preventDefault();
if (modal) {
modal.classList.add('is-open');
modal.setAttribute('aria-hidden', 'false');
if (trigger.getAttribute('aria-expanded')) trigger.setAttribute('aria-expanded', 'true');
document.body.style.overflow = 'hidden';
}
});
}
if (modal) {
function closeMega() {
modal.classList.remove('is-open');
modal.setAttribute('aria-hidden', 'true');
if (trigger && trigger.getAttribute('aria-expanded')) trigger.setAttribute('aria-expanded', 'false');
document.body.style.overflow = '';
}
if (closers.length) {
closers.forEach(function(el) {
el.addEventListener('click', closeMega);
});
}
modal.addEventListener('keydown', function(e) {
if (e.key === 'Escape') closeMega();
});
}
(function navDropdowns() {
var items = document.querySelectorAll('.ec-headerNavMain__item--hasDropdown[data-nav-dropdown]');
var links = document.querySelectorAll('.ec-headerNavMain__link--dropdown');
function closeAll() {
items.forEach(function(li) {
li.classList.remove('is-open');
var a = li.querySelector('.ec-headerNavMain__link--dropdown');
if (a) a.setAttribute('aria-expanded', 'false');
});
}
links.forEach(function(a) {
a.addEventListener('click', function(e) {
var li = a.closest('.ec-headerNavMain__item--hasDropdown');
if (!li) return;
var dropdown = li.querySelector('.ec-headerNavMain__dropdown');
if (!dropdown) return;
e.preventDefault();
var isOpen = li.classList.contains('is-open');
closeAll();
if (!isOpen) {
li.classList.add('is-open');
a.setAttribute('aria-expanded', 'true');
}
});
});
document.addEventListener('click', function(e) {
if (!e.target.closest('.ec-headerNavMain__item--hasDropdown')) closeAll();
});
})();
});
})();
</script>
";
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
public function getTemplateName()
{
return "__string_template__a8622c249d6509d1e837099f3f6022f6";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 279 => 115, 276 => 114, 272 => 112, 265 => 107, 258 => 102, 251 => 98, 247 => 96, 240 => 92, 234 => 91, 231 => 90, 225 => 89, 213 => 85, 208 => 83, 204 => 82, 199 => 79, 191 => 77, 188 => 76, 180 => 74, 178 => 73, 173 => 71, 165 => 68, 161 => 66, 158 => 65, 155 => 64, 150 => 63, 146 => 62, 143 => 61, 141 => 60, 135 => 57, 129 => 54, 124 => 52, 119 => 49, 117 => 48, 115 => 47, 113 => 46, 106 => 34, 90 => 33, 84 => 30, 78 => 27, 73 => 24, 68 => 21, 65 => 20, 58 => 15, 50 => 10, 45 => 7,);
}
public function getSourceContext()
{
return new Source("{#
temptu-style: two-row header
Row 1 (black): fade message (送料無料) | search, cart
Row 2 (white): logo | ITEMS, ABOUT, LINK, CONTACT | mypage, cart summary (点数 ¥0)
#}
{# Top bar (black) #}
<div class=\"ec-headerTopBar\">
<div class=\"ec-headerTopBar__inner\">
<div class=\"ec-headerTopBar__left\">
<button type=\"button\" class=\"ec-headerTopBar__messagePrev\" aria-label=\"{{ '前のメッセージ'|trans }}\"><</button>
<div class=\"ec-headerTopBar__message\" data-current=\"1\">
<span class=\"ec-headerTopBar__messageItem ec-headerTopBar__messageItem--1\"><i class=\"fas fa-truck\"></i> 33,000 円(税込)以上のご注文で送料無料(国内配送・一部地域を除く)</span>
<span class=\"ec-headerTopBar__messageItem ec-headerTopBar__messageItem--2\">Complimentary domestic shipping on orders over ¥33,000.*</span>
</div>
<button type=\"button\" class=\"ec-headerTopBar__messageNext\" aria-label=\"{{ '次のメッセージ'|trans }}\">></button>
</div>
</div>
</div>
{# Search form (toggle from top bar) - hidden by default #}
<div class=\"ec-headerSearchWrap is-pc\" style=\"display:none;\">
{{ render(path('block_search_product')) }}
</div>
{# Main header (white) #}
<div class=\"ec-headerMain\">
<div class=\"ec-headerMain__inner\">
<div class=\"ec-headerMain__left\">
<a href=\"#\" class=\"ec-headerMain__searchToggle ec-headerTopBar__searchToggle\" aria-label=\"{{ '検索'|trans }}\"><i class=\"fas fa-search\"></i></a>
</div>
<div class=\"ec-headerMain__centerLogo\">
{{ include('Block/logo.twig') }}
</div>
<div class=\"ec-headerMain__right\">
<div class=\"ec-headerMain__account\">{% if is_granted('ROLE_USER') %}<a href=\"{{ url('mypage') }}\" aria-label=\"{{ 'マイページ'|trans }}\"><i class=\"fas fa-user\"></i></a>{% else %}<a href=\"{{ url('mypage_login') }}\" aria-label=\"{{ 'ログイン'|trans }}\"><i class=\"fas fa-user\"></i></a>{% endif %}</div>
<div class=\"ec-headerMain__favorite\"><a href=\"{{ url('mypage_favorite') }}\" aria-label=\"{{ 'お気に入り'|trans }}\"><i class=\"far fa-heart\"></i></a></div>
<div class=\"ec-headerRole__cart\">
{#
This file is part of EC-CUBE
Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
http://www.ec-cube.co.jp/
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% set Carts = get_all_carts() %}
{% set totalPrice = get_carts_total_price() %}
{% set totalQuantity = get_carts_total_quantity() %}
<div class=\"ec-cartNaviWrap\">
<div class=\"ec-cartNavi\">
<div class=\"ec-cartNavi__div\">
<img src=\"{{ asset('assets/icon/icon_cart.svg') }}\" alt=\"\">
<br>
<span class=\"ec-cartNavi__badge\">{{ totalQuantity|number_format }}</span>
</div>
<div class=\"ec-cartNavi__label\">
<div class=\"ec-cartNavi__price\">TOTAL<br>{{ totalPrice|price }}</div>
</div>
</div>
{% if totalQuantity > 0 %}
<div class=\"ec-cartNaviIsset\">
{% for Cart in Carts %}
{% for CartItem in Cart.CartItems %}
{% set ProductClass = CartItem.ProductClass %}
{% set Product = ProductClass.Product %}
<div class=\"ec-cartNaviIsset__cart\">
<div class=\"ec-cartNaviIsset__cartImage\">
<img src=\"{{ asset(class_image(Product, ProductClass)|no_image_product, 'save_image') }}\" alt=\"{{ Product.name }}\"/>
</div>
<div class=\"ec-cartNaviIsset__cartContent\">
<div class=\"ec-cartNaviIsset__cartContentTitle\">{{ Product.name }}
<div class=\"ec-font-size-1\">
{% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
{{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}
{% endif %}
{% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
<br>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}
{% endif %}
</div>
</div>
<div class=\"ec-cartNaviIsset__cartContentPrice\">
{{ CartItem.price|price }}
<div class=\"ec-cartNaviIsset__cartContentTax\">{{ '税込'|trans }}</div>
</div>
<div class=\"ec-cartNaviIsset__cartContentNumber\">{{ '数量'|trans }} {{ CartItem.quantity|number_format }}</div>
</div>
</div>
{% endfor %}
{% endfor %}
<div class=\"ec-cartNaviIsset__action\">
<a class=\"ec-blockBtn--action\" href=\"{{ url('cart') }}\">{{ 'カートへ進む'|trans }}</a>
<a class=\"ec-blockBtn ec-cartNavi--cancel\">{{ 'キャンセル'|trans }}</a>
</div>
</div>
{% else %}
<div class=\"ec-cartNaviNull\">
<div class=\"ec-cartNaviNull__message\">
<p>{{ '現在カート内に商品はございません。'|trans }}</p>
</div>
</div>
{% endif %}
</div>
</div>
</div>
<div class=\"ec-headerRole__navSP is-sp\">
{{ include('Block/nav_sp.twig') }}
</div>
</div>
</div>
{# モーダルは .ec-headerMain__center の外に配置(親の display:none の影響を受けない) #}
{{ include('Block/mega_menu_modal.twig') }}
{# Search form SP: キーワード検索のみ、アイコンタップで表示 #}
<div class=\"ec-search is-sp\" id=\"ec-search-sp\" style=\"display:none;\">
{{ render(path('block_search_product', { mode: 'keyword_only' })) }}
</div>
<script>
(function() {
document.addEventListener('DOMContentLoaded', function() {
var t = document.querySelector('.ec-headerTopBar__searchToggle');
var w = document.querySelector('.ec-headerSearchWrap');
var spSearch = document.getElementById('ec-search-sp');
if (t) {
t.addEventListener('click', function(e) {
e.preventDefault();
if (w) w.style.display = w.style.display === 'none' ? 'block' : 'none';
if (spSearch) spSearch.style.display = spSearch.style.display === 'none' ? 'block' : 'none';
});
}
(function messageSlider() {
var el = document.querySelector('.ec-headerTopBar__message');
var prev = document.querySelector('.ec-headerTopBar__messagePrev');
var next = document.querySelector('.ec-headerTopBar__messageNext');
if (!el || !prev || !next) return;
var current = 1;
var total = 2;
var intervalId = null;
var duration = 5000;
function show(n) {
current = (n - 1 + total) % total + 1;
el.setAttribute('data-current', String(current));
}
function goNext() {
show(current === 1 ? 2 : 1);
resetTimer();
}
function goPrev() {
show(current === 2 ? 1 : 2);
resetTimer();
}
function resetTimer() {
if (intervalId) clearInterval(intervalId);
intervalId = setInterval(goNext, duration);
}
prev.addEventListener('click', function(e) { e.preventDefault(); goPrev(); });
next.addEventListener('click', function(e) { e.preventDefault(); goNext(); });
intervalId = setInterval(goNext, duration);
})();
var modal = document.getElementById('mega-menu-modal');
var trigger = document.querySelector('.mega-menu__trigger[data-mega-open]');
var closers = document.querySelectorAll('[data-mega-close]');
if (trigger) {
trigger.addEventListener('click', function(e) {
e.preventDefault();
if (modal) {
modal.classList.add('is-open');
modal.setAttribute('aria-hidden', 'false');
if (trigger.getAttribute('aria-expanded')) trigger.setAttribute('aria-expanded', 'true');
document.body.style.overflow = 'hidden';
}
});
}
if (modal) {
function closeMega() {
modal.classList.remove('is-open');
modal.setAttribute('aria-hidden', 'true');
if (trigger && trigger.getAttribute('aria-expanded')) trigger.setAttribute('aria-expanded', 'false');
document.body.style.overflow = '';
}
if (closers.length) {
closers.forEach(function(el) {
el.addEventListener('click', closeMega);
});
}
modal.addEventListener('keydown', function(e) {
if (e.key === 'Escape') closeMega();
});
}
(function navDropdowns() {
var items = document.querySelectorAll('.ec-headerNavMain__item--hasDropdown[data-nav-dropdown]');
var links = document.querySelectorAll('.ec-headerNavMain__link--dropdown');
function closeAll() {
items.forEach(function(li) {
li.classList.remove('is-open');
var a = li.querySelector('.ec-headerNavMain__link--dropdown');
if (a) a.setAttribute('aria-expanded', 'false');
});
}
links.forEach(function(a) {
a.addEventListener('click', function(e) {
var li = a.closest('.ec-headerNavMain__item--hasDropdown');
if (!li) return;
var dropdown = li.querySelector('.ec-headerNavMain__dropdown');
if (!dropdown) return;
e.preventDefault();
var isOpen = li.classList.contains('is-open');
closeAll();
if (!isOpen) {
li.classList.add('is-open');
a.setAttribute('aria-expanded', 'true');
}
});
});
document.addEventListener('click', function(e) {
if (!e.target.closest('.ec-headerNavMain__item--hasDropdown')) closeAll();
});
})();
});
})();
</script>
", "__string_template__a8622c249d6509d1e837099f3f6022f6", "");
}
public function checkSecurity()
{
static $tags = array("if" => 33, "set" => 46, "for" => 62);
static $filters = array("escape" => 10, "trans" => 10, "number_format" => 54, "price" => 57, "no_image_product" => 68);
static $functions = array("render" => 21, "path" => 21, "include" => 30, "is_granted" => 33, "url" => 33, "get_all_carts" => 46, "get_carts_total_price" => 47, "get_carts_total_quantity" => 48, "asset" => 52, "class_image" => 68);
try {
$this->sandbox->checkSecurity(
['if', 'set', 'for'],
['escape', 'trans', 'number_format', 'price', 'no_image_product'],
['render', 'path', 'include', 'is_granted', 'url', 'get_all_carts', 'get_carts_total_price', 'get_carts_total_quantity', 'asset', 'class_image']
);
} catch (SecurityError $e) {
$e->setSourceContext($this->source);
if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
}
}