<?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;
/* Cart/index.twig */
class __TwigTemplate_ce8963c97952d9d77caf52b20bb21116 extends \Eccube\Twig\Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'javascript' => [$this, 'block_javascript'],
'stylesheet' => [$this, 'block_stylesheet'],
'main' => [$this, 'block_main'],
];
$this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension');
$this->checkSecurity();
}
protected function doGetParent(array $context)
{
// line 104
return "default_frame.twig";
}
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", "Cart/index.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Cart/index.twig"));
// line 106
$context["body_class"] = "cart_page";
// line 104
$this->parent = $this->loadTemplate("default_frame.twig", "Cart/index.twig", 104);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 5
public function block_javascript($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(), "block", "javascript"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascript"));
// line 6
echo " <script>
\$(function() {
";
// line 9
if ( !twig_test_empty((isset($context["favorites_product_id"]) || array_key_exists("favorites_product_id", $context) ? $context["favorites_product_id"] : (function () { throw new RuntimeError('Variable "favorites_product_id" does not exist.', 9, $this->source); })()))) {
// line 10
echo " alert(\"お気に入りに追加しました。\");
";
}
// line 12
echo "
";
// line 13
$context["current_domain"] = twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 13, $this->source); })()), "request", [], "any", false, false, true, 13), "getHost", [], "method", false, false, true, 13);
// line 14
echo "
";
// line 15
$context["is_prod"] = twig_in_filter("web-order.shikomel.com", (isset($context["current_domain"]) || array_key_exists("current_domain", $context) ? $context["current_domain"] : (function () { throw new RuntimeError('Variable "current_domain" does not exist.', 15, $this->source); })()));
// line 16
echo " ";
$context["is_stg"] = twig_in_filter("web-order-stg.shikomel.com", (isset($context["current_domain"]) || array_key_exists("current_domain", $context) ? $context["current_domain"] : (function () { throw new RuntimeError('Variable "current_domain" does not exist.', 16, $this->source); })()));
// line 17
echo " ";
$context["custom_customer_id"] = (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_USER")) ? (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 17, $this->source); })()), "user", [], "any", false, false, true, 17), "id", [], "any", false, false, true, 17)) : (""));
// line 18
echo "
// カート表示イベントの送付
";
// line 20
if ((isset($context["is_prod"]) || array_key_exists("is_prod", $context) ? $context["is_prod"] : (function () { throw new RuntimeError('Variable "is_prod" does not exist.', 20, $this->source); })())) {
// line 21
echo "
let cartData = [];
let totalPrice = 0;
";
// line 25
$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.', 25, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["Cart"]) {
// line 26
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["Cart"], "CartItems", [], "any", false, false, true, 26));
foreach ($context['_seq'] as $context["_key"] => $context["CartItem"]) {
// line 27
echo " ";
$context["ProductClass"] = twig_get_attribute($this->env, $this->source, $context["CartItem"], "ProductClass", [], "any", false, false, true, 27);
// line 28
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.', 28, $this->source); })()), "Product", [], "any", false, false, true, 28);
// line 29
echo "
cartData.push({
id: \"";
// line 31
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.', 31, $this->source); })()), "id", [], "any", false, false, true, 31), 31, $this->source), "html", null, true);
echo "\",
name: \"";
// line 32
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.', 32, $this->source); })()), "name", [], "any", false, false, true, 32), 32, $this->source), "html", null, true);
echo "\",
price: \"";
// line 33
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["CartItem"], "total_price", [], "any", false, false, true, 33), 33, $this->source), "html", null, true);
echo "\",
quantity: ";
// line 34
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, 34), 34, $this->source)), "html", null, true);
echo ",
});
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['CartItem'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 37
echo " totalPrice = ";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Cart"], "totalPrice", [], "any", false, false, true, 37), 37, $this->source), "html", null, true);
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 39
echo "
if (cartData.length > 0) {
fbq('track', 'InitiateCheckout', {
content_type: \"CartInfo\",
content_ids: cartData.map(item => item.id),
content_name: cartData.map(item => item.name).join(\", \"),
contents: cartData.map(item => ({
id: item.id,
name: item.name,
quantity: item.quantity,
price: item.price
})),
currency: \"JPY\",
num_items: cartData.reduce((total, item) => total + item.quantity, 0),
value: 55
});
// Metaへイベント送付
fbq('trackCustom', 'ce_show_cart', {
content_type: \"CartInfo\",
content_ids: cartData.map(item => item.id),
content_name: cartData.map(item => item.name).join(\", \"),
contents: cartData.map(item => ({
id: item.id,
name: item.name,
quantity: item.quantity,
price: item.price
})),
currency: \"JPY\",
num_items: cartData.reduce((total, item) => total + item.quantity, 0),
value: 55
});
// GAへイベント送付
window.dataLayer.push({
event: 'ce_show_cart',
custom_event_name: 'ce_show_cart',
custom_contents: cartData.map(item => ({
id: item.id,
name: item.name,
quantity: item.quantity,
price: item.price
})),
custom_content_ids: cartData.map(item => item.id),
custom_content_names: cartData.map(item => item.name).join(\", \"),
custom_num_item: cartData.reduce((total, item) => total + item.quantity, 0),
custom_total_price: totalPrice,
custom_customer_id: '";
// line 86
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["custom_customer_id"]) || array_key_exists("custom_customer_id", $context) ? $context["custom_customer_id"] : (function () { throw new RuntimeError('Variable "custom_customer_id" does not exist.', 86, $this->source); })()), 86, $this->source), "html", null, true);
echo "',
custom_user_agent: \$(\"#user_agent\").val(),
custom_is_ig: \$(\"#is_ig\").val(),
custom_is_line: \$(\"#is_line\").val(),
custom_referer: \$(\"#referer\").val(),
custom_real_ip: \$(\"#real_ip\").val(),
});
// Lineへイベント送付
_lt('send', 'cv', {
type: 'ce_show_cart'
},['d6fb195c-aa19-4109-8ea0-7b1d883fb349']);
}
";
}
// line 100
echo " });
</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 108
public function block_stylesheet($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(), "block", "stylesheet"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheet"));
// line 109
echo " <style>
.non_product {
margin-top: 24px;
text-align: center;
font-size: 14px;
margin-bottom: 24px;
}
.non_product_continue {
margin-bottom: 0px;
border-radius: 6px;
border: solid 1px #CCCCCC;
background-color: unset;
color: #525263;
font-weight: 600;
text-align: center;
cursor: pointer;
font-size: 14px;
padding: 10px 16px;
text-decoration: none;
display: block;
height: 56px;
line-height: 56px;
padding-top: 0;
padding-bottom: 0;
}
.ec-cartRole img.minus_btn_img {
width: 32px;
height: 32px;
}
.ec-cartRole img.plus_btn_img {
width: 32px;
height: 32px;
}
.ec-cartRole .quantity {
font-size: 18px;
border-bottom: solid 2px;
width: 58px;
text-align: center;
font-weight: bold;
margin-left: 8px;
margin-right: 8px;
}
.ec-cartRow__container {
display: flex;
align-items: flex-start;
}
.ec-cart-img {
margin-right: 10px;
height: 60px;
}
.ec-cartRow__unitPrice {
font-size: 14px;
}
.ec-cart-pro-info a {
font-size: 14px;
color: #1F9FCB;
font-weight: bold;
}
.separater {
background-color: #F5F5F5;
width: 100%;
}
.ec-alert-warning .ec-alert-warning__icon img {
display: inline-block;
width: 16px;
height: 16px;
}
.ec-cartRole .ec-cartRole__error .ec-alert-warning {
max-width: 100%;
display: flex;
}
.ec-alert-warning .ec-alert-warning__text {
color: #DE5D50;
font-size: 13px;
text-align: left;
font-weight: normal;
margin-top: 4px;
width: 100%;
}
.ec-alert-warning {
margin-bottom: 24px;
background: #FFF;
border-radius: 6px;
border: solid 1px #DE5D50;
text-align: left;
display: flex;
margin-right: 20px;
margin-left: 20px;
width: auto;
}
";
// line 215
echo " @media screen and (min-width: 1025px) {
.ec-cartRole__error {
margin: 0 auto;
padding-left: 20px;
padding-right: 20px;
max-width: 1130px;
}
hr:not([size]) {
height: 1px;
background-color: #ddd;
opacity: 1;
}
.separater {
background-color: #DDDDDD;
}
.ec-cartRow__amountUpDown {
padding-left: 145px;
}
.ec-cart-pro-info a {
font-size: 16px;
color: #1F9FCB;
}
.ec-cart-img img {
width: 130px;
height: 105px;
max-width: 130px;
margin-right: 15px;
border-radius: 4px;
}
#form_cart_frame {
display: flex;
justify-content: space-around;
}
.ec-cartRole .ec-cartRole__cart {
padding: 0px; width: 50%; margin-left: 0px; margin-right: 100px;
}
.is_pc {
display: block;
}
.is_sp {
display: none;
}
}
";
// line 269
echo " @media screen and (max-width: 1024px) {
hr:not([size]) {
height: 8px;
background-color: #f5f5f5;
opacity: 1;
}
.separater {
background-color: #DDDDDD;
}
.ec-cart-img {
margin-right: 10px; min-width: 74px;
}
.ec-cart-img img {
width: 74px;
height: 60px;
border-radius: 4px;
}
.is_pc {
display: none;
}
.is_sp {
display: block;
}
}
</style>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 301
public function block_main($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(), "block", "main"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));
// line 302
echo "
<div class=\"ec-role\">
<div class=\"ec-pageHeader\">
<h1 style=\"border-top: none; padding: 12px 0 12px; margin-bottom: 8px;\">";
// line 305
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カート"), "html", null, true);
echo "</h1>
</div>
</div>
";
// line 309
$context["productStr"] = twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 309, $this->source); })()), "session", [], "any", false, false, true, 309), "flashbag", [], "any", false, false, true, 309), "get", [0 => "eccube.front.request.product"], "method", false, false, true, 309);
// line 310
echo "
";
// line 311
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 311, $this->source); })()), "session", [], "any", false, false, true, 311), "flashbag", [], "any", false, false, true, 311), "get", [0 => "eccube.front.request.error"], "method", false, false, true, 311));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["error"]) {
// line 312
echo " ";
$context["idx"] = twig_get_attribute($this->env, $this->source, $context["loop"], "index0", [], "any", false, false, true, 312);
// line 313
echo " <div class=\"ec-cartRole__error\">
<div class=\"ec-alert-warning\">
<div class=\"ec-alert-warning__icon\"><img src=\"";
// line 315
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/common/alert_icon.png", "user_data"), "html", null, true);
echo "\"></div>
<div class=\"ec-alert-warning__text\">
";
// line 317
if (twig_get_attribute($this->env, $this->source, ($context["productStr"] ?? null), (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 317, $this->source); })()), [], "array", true, true, true, 317)) {
// line 318
echo " ";
echo twig_nl2br(twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($this->sandbox->ensureToStringAllowed($context["error"], 318, $this->source), ["%product%" => twig_get_attribute($this->env, $this->source, (isset($context["productStr"]) || array_key_exists("productStr", $context) ? $context["productStr"] : (function () { throw new RuntimeError('Variable "productStr" does not exist.', 318, $this->source); })()), (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 318, $this->source); })()), [], "array", false, false, true, 318)]), "html", null, true));
echo "
";
} else {
// line 320
echo " ";
echo twig_nl2br(twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($this->sandbox->ensureToStringAllowed($context["error"], 320, $this->source)), "html", null, true));
echo "
";
}
// line 322
echo " </div>
</div>
</div>
";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['error'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 326
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 326, $this->source); })()), "session", [], "any", false, false, true, 326), "flashbag", [], "any", false, false, true, 326), "get", [0 => "eccube.front.cart.error"], "method", false, false, true, 326));
foreach ($context['_seq'] as $context["_key"] => $context["error"]) {
// line 327
echo " <div class=\"ec-cartRole__error\">
<div class=\"ec-alert-warning\">
<div class=\"ec-alert-warning__icon\"><img src=\"";
// line 329
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/common/alert_icon.png", "user_data"), "html", null, true);
echo "\"></div>
<div class=\"ec-alert-warning__text\">
";
// line 331
echo twig_nl2br(twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($this->sandbox->ensureToStringAllowed($context["error"], 331, $this->source)), "html", null, true));
echo "
</div>
</div>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['error'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 336
echo "
<div class=\"ec-cartRole\" style=\"padding: 0px; display: block;\">
";
// line 339
if (((isset($context["totalQuantity"]) || array_key_exists("totalQuantity", $context) ? $context["totalQuantity"] : (function () { throw new RuntimeError('Variable "totalQuantity" does not exist.', 339, $this->source); })()) > 0)) {
// line 340
echo " ";
if ((twig_length_filter($this->env, (isset($context["Carts"]) || array_key_exists("Carts", $context) ? $context["Carts"] : (function () { throw new RuntimeError('Variable "Carts" does not exist.', 340, $this->source); })())) > 1)) {
// line 341
echo " <div class=\"ec-cartRole__error\">
<div class=\"ec-alert-warning\">
<div class=\"ec-alert-warning__text\">
";
// line 344
echo twig_nl2br(twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("同時購入できない商品がカートに含まれています。"), "html", null, true));
echo "
</div>
</div>
</div>
";
}
// line 349
echo "
<form name=\"form\" id=\"form_cart\" method=\"post\" action=\"";
// line 350
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("cart");
echo "\">
";
// line 351
$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.', 351, $this->source); })()));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["CartIndex"] => $context["Cart"]) {
// line 352
echo " ";
$context["cartKey"] = twig_get_attribute($this->env, $this->source, $context["Cart"], "cart_key", [], "any", false, false, true, 352);
// line 353
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 353, $this->source); })()), "session", [], "any", false, false, true, 353), "flashbag", [], "any", false, false, true, 353), "get", [0 => (("eccube.front.cart." . (isset($context["cartKey"]) || array_key_exists("cartKey", $context) ? $context["cartKey"] : (function () { throw new RuntimeError('Variable "cartKey" does not exist.', 353, $this->source); })())) . ".request.error")], "method", false, false, true, 353));
foreach ($context['_seq'] as $context["_key"] => $context["error"]) {
// line 354
echo " <div class=\"ec-cartRole__error\">
<div class=\"ec-alert-warning\">
<div class=\"ec-alert-warning__icon\"><img src=\"";
// line 356
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/common/alert_icon.png", "user_data"), "html", null, true);
echo "\"></div>
<div class=\"ec-alert-warning__text\">
";
// line 358
echo twig_nl2br(twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($this->sandbox->ensureToStringAllowed($context["error"], 358, $this->source)), "html", null, true));
echo "
</div>
</div>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['error'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 363
echo "
<div id=\"form_cart_frame\">
<div class=\"ec-cartRole__cart\" style=\"\">
<div class=\"\">
";
// line 367
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["Cart"], "CartItems", [], "any", false, false, true, 367));
foreach ($context['_seq'] as $context["_key"] => $context["CartItem"]) {
// line 368
echo " ";
$context["ProductClass"] = twig_get_attribute($this->env, $this->source, $context["CartItem"], "ProductClass", [], "any", false, false, true, 368);
// line 369
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.', 369, $this->source); })()), "Product", [], "any", false, false, true, 369);
// line 370
echo " <div style=\"padding-right: 16px; padding-left: 16px;\">
<div style=\"margin-top: 20px;\">
<div class=\"ec-cartRow__container\" style=\"display: flex; align-items: flex-start;\">
<div class=\"ec-cart-img\" style=\"\">
<a target=\"_blank\" href=\"";
// line 374
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_detail", ["id" => 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.', 374, $this->source); })()), "id", [], "any", false, false, true, 374)]), "html", null, true);
echo "\">
<img src=\"";
// line 375
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.', 375, $this->source); })()), "MainListImage", [], "any", false, false, true, 375), 375, $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.', 375, $this->source); })()), "name", [], "any", false, false, true, 375), 375, $this->source), "html", null, true);
echo "\"/>
</a>
</div>
<div class=\"ec-cart-pro-info\">
<div class=\"ec-cartRow__name\" style=\"line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;\">
<a target=\"_blank\" style=\"\" href=\"";
// line 380
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_detail", ["id" => 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.', 380, $this->source); })()), "id", [], "any", false, false, true, 380)]), "html", null, true);
echo "\">
";
// line 381
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.', 381, $this->source); })()), "name", [], "any", false, false, true, 381), 381, $this->source), "html", null, true);
echo "
</a>
</div>
<div class=\"ec-cartRow__unitPrice\" style=\"margin-top: 5px;\">";
// line 384
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["CartItem"], "price", [], "any", false, false, true, 384), 384, $this->source)), "html", null, true);
echo "円
";
// line 385
if (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.', 385, $this->source); })()), "standard_text", [], "any", false, false, true, 385)) {
echo "(";
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.', 385, $this->source); })()), "standard_text", [], "any", false, false, true, 385), 385, $this->source), "html", null, true);
echo ")";
}
// line 386
echo " </div>
</div>
</div>
</div>
<div style=\"display: flex; margin-top: 8px;
";
// line 392
if ( !twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["CartItem"], "ProductClass", [], "any", false, false, true, 392), "Product", [], "any", false, false, true, 392), "is_recipe_book", [], "any", false, false, true, 392)) {
echo "
justify-content: space-between;
";
} else {
// line 395
echo " justify-content: end;
";
}
// line 397
echo " align-items: flex-end;\">
";
// line 399
echo " ";
if ( !twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["CartItem"], "ProductClass", [], "any", false, false, true, 399), "Product", [], "any", false, false, true, 399), "is_recipe_book", [], "any", false, false, true, 399)) {
// line 400
echo " <div class=\"ec-cartRow__amountUpDown\" style=\"display: flex;\">
";
// line 401
if ((twig_get_attribute($this->env, $this->source, $context["CartItem"], "quantity", [], "any", false, false, true, 401) > 1)) {
// line 402
echo " <a class=\"plus_btn\" href=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("cart_handle_item", ["operation" => "down", "productClassId" => 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.', 402, $this->source); })()), "id", [], "any", false, false, true, 402)]), "html", null, true);
echo "\" ";
echo $this->extensions['Eccube\Twig\Extension\CsrfExtension']->getCsrfTokenForAnchor();
echo " class=\"ec-cartRow__amountDownButton load-overlay\" data-method=\"put\" data-confirm=\"false\">
<span class=\"ec-cartRow__amountDownButton__icon\">
<img src=\"";
// line 404
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/common/minus_btn.png", "user_data"), "html", null, true);
echo "\" alt=\"reduce\" class=\"minus_btn_img\">
</span>
</a>
";
} else {
// line 408
echo " <div class=\"ec-cartRow__amountDownButtonDisabled\">
<span class=\"ec-cartRow__amountDownButton__icon\">
<img src=\"";
// line 410
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/common/minus_btn_disabled.png", "user_data"), "html", null, true);
echo "\" alt=\"reduce\" class=\"minus_btn_img\">
</span>
</div>
";
}
// line 414
echo " <div class=\"quantity\">";
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, 414), 414, $this->source)), "html", null, true);
echo "</div>
<a href=\"";
// line 416
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("cart_handle_item", ["operation" => "up", "productClassId" => 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.', 416, $this->source); })()), "id", [], "any", false, false, true, 416)]), "html", null, true);
echo "\" ";
echo $this->extensions['Eccube\Twig\Extension\CsrfExtension']->getCsrfTokenForAnchor();
echo " class=\"ec-cartRow__amountUpButton load-overlay\" data-method=\"put\" data-confirm=\"false\">
<span class=\"ec-cartRow__amountUpButton__icon\">
<img src=\"";
// line 418
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/common/plus_btn.png", "user_data"), "html", null, true);
echo "\" alt=\"increase\" class=\"plus_btn_img\">
</span>
</a>
</div>
";
}
// line 423
echo " <div class=\"ec-cartRow__sutbtotalSP\">
<span style=\"font-size: 14px;\">小計</span>
<span style=\"font-size: 20px; font-weight: bold;\">";
// line 425
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["CartItem"], "total_price", [], "any", false, false, true, 425), 425, $this->source)), "html", null, true);
echo "</span>
<span style=\"font-size: 14px;\">円</span>
<span style=\"font-size: 14px;\">(税込)</span>
</div>
</div>
<div style=\"text-align: right; margin-top: 14px;\">
";
// line 431
if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_USER")) {
// line 432
echo " <a href=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_add_favorite", ["id" => 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.', 432, $this->source); })()), "id", [], "any", false, false, true, 432)]), "html", null, true);
echo "\" class=\"ec-icon\" data-method=\"post\">
<span style=\"font-size: 14px; text-decoration: underline; color: #525263; margin-right: 20px;\">お気に入りに追加</span>
</a>
";
}
// line 436
echo " <a href=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("cart_handle_item", ["operation" => "remove", "productClassId" => 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.', 436, $this->source); })()), "id", [], "any", false, false, true, 436)]), "html", null, true);
echo "\" ";
echo $this->extensions['Eccube\Twig\Extension\CsrfExtension']->getCsrfTokenForAnchor();
echo " class=\"ec-icon\" data-method=\"put\" data-message=\"カートから商品を削除してもよろしいですか?\">
<span style=\"font-size: 14px; text-decoration: underline; color: #525263;\">削除</span>
</a>
</div>
</div>
<hr class=\"separater\" style=\"\">
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['CartItem'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 443
echo " </div>
</div>
<div class=\"ec-cartRole__actions\" style=\"padding-right: 16px; padding-left: 16px; margin-right: 0px; width: 375px;\">
<div style=\"position: sticky; top: 50px;\">
<div class=\"ec-cartRole__total\" style=\"display: flex; justify-content: space-between; align-items: center; height: 36px; margin: 16px 0px; padding: 0px;\">
<span style=\"font-size: 18px; font-weight: bold;\">
合計金額<span style=\"font-size: 14px; font-weight: normal;\">(";
// line 449
echo twig_escape_filter($this->env, twig_length_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Cart"], "CartItems", [], "any", false, false, true, 449), 449, $this->source)), "html", null, true);
echo "商品)</span>
</span>
<span class=\"ec-cartRole__totalAmount\" style=\"font-size: 24px; font-weight: bold;\">
";
// line 452
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Cart"], "totalPrice", [], "any", false, false, true, 452), 452, $this->source)), "html", null, true);
echo "
<span style=\"font-size: 14px; font-weight: bold;\">円(税込)</span>
</span>
</div>
";
// line 458
echo " ";
if ((array_key_exists("isShowCouponCode", $context) && (isset($context["isShowCouponCode"]) || array_key_exists("isShowCouponCode", $context) ? $context["isShowCouponCode"] : (function () { throw new RuntimeError('Variable "isShowCouponCode" does not exist.', 458, $this->source); })()))) {
// line 459
echo " <div class=\"\" style=\"margin: auto;\">
<img src=\"";
// line 460
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/common/has_3000_coupon_cart.png", "user_data"), "html", null, true);
echo "\" style=\"padding: 0px 10px;\">
</div>
";
}
// line 463
echo "
<a class=\"ec-blockBtn--action\" style=\"max-width: 343px; margin: auto; background-color: #DE5D50; border-color: #DE5D50;\" href=\"";
// line 464
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("shopping_nonmember");
echo "\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ご注文手続きへ"), "html", null, true);
echo "</a>
";
// line 465
if (twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, true, 465)) {
// line 466
echo " <div style=\"text-align: center; margin-bottom: 16px; margin-top: 16px; line-height: 39px;\">
<a style=\"color: #1F9FCB;\" href=\"";
// line 467
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("homepage");
echo "\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お買い物を続ける"), "html", null, true);
echo "</a>
</div>
";
}
// line 470
echo " </div>
</div>
";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['CartIndex'], $context['Cart'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 473
echo " </div>
</form>
";
} else {
// line 476
echo " ";
$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.', 476, $this->source); })()));
foreach ($context['_seq'] as $context["CartIndex"] => $context["Cart"]) {
// line 477
echo " ";
$context["cartKey"] = twig_get_attribute($this->env, $this->source, $context["Cart"], "cart_key", [], "any", false, false, true, 477);
// line 478
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 478, $this->source); })()), "session", [], "any", false, false, true, 478), "flashbag", [], "any", false, false, true, 478), "get", [0 => (("eccube.front.cart." . (isset($context["cartKey"]) || array_key_exists("cartKey", $context) ? $context["cartKey"] : (function () { throw new RuntimeError('Variable "cartKey" does not exist.', 478, $this->source); })())) . ".request.error")], "method", false, false, true, 478));
foreach ($context['_seq'] as $context["_key"] => $context["error"]) {
// line 479
echo " <div class=\"ec-cartRole__error\">
<div class=\"ec-alert-warning\">
<div class=\"ec-alert-warning__icon\"><img src=\"";
// line 481
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/icon/exclamation-white.svg"), "html", null, true);
echo "\"></div>
<div class=\"ec-alert-warning__text\">
";
// line 483
echo twig_nl2br(twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($this->sandbox->ensureToStringAllowed($context["error"], 483, $this->source)), "html", null, true));
echo "
</div>
</div>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['error'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 488
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['CartIndex'], $context['Cart'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 489
echo " <div class=\"ec-role\">
<div class=\"ec-off3Grid\">
<div class=\"ec-off3Grid__cell\">
<div class=\"non_product\">";
// line 492
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートに商品がありません。"), "html", null, true);
echo "</div>
<div style=\"margin-bottom: 24px;\">
<a class=\"non_product_continue\" href=\"";
// line 494
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("homepage");
echo "\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お買い物を続ける"), "html", null, true);
echo "</a>
</div>
</div>
</div>
</div>
";
}
// line 500
echo " </div>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
public function getTemplateName()
{
return "Cart/index.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 948 => 500, 937 => 494, 932 => 492, 927 => 489, 921 => 488, 910 => 483, 905 => 481, 901 => 479, 896 => 478, 893 => 477, 888 => 476, 883 => 473, 867 => 470, 859 => 467, 856 => 466, 854 => 465, 848 => 464, 845 => 463, 839 => 460, 836 => 459, 833 => 458, 825 => 452, 819 => 449, 811 => 443, 795 => 436, 787 => 432, 785 => 431, 776 => 425, 772 => 423, 764 => 418, 757 => 416, 751 => 414, 744 => 410, 740 => 408, 733 => 404, 725 => 402, 723 => 401, 720 => 400, 717 => 399, 714 => 397, 710 => 395, 704 => 392, 696 => 386, 690 => 385, 686 => 384, 680 => 381, 676 => 380, 666 => 375, 662 => 374, 656 => 370, 653 => 369, 650 => 368, 646 => 367, 640 => 363, 629 => 358, 624 => 356, 620 => 354, 615 => 353, 612 => 352, 595 => 351, 591 => 350, 588 => 349, 580 => 344, 575 => 341, 572 => 340, 570 => 339, 565 => 336, 554 => 331, 549 => 329, 545 => 327, 540 => 326, 523 => 322, 517 => 320, 511 => 318, 509 => 317, 504 => 315, 500 => 313, 497 => 312, 480 => 311, 477 => 310, 475 => 309, 468 => 305, 463 => 302, 453 => 301, 413 => 269, 358 => 215, 251 => 109, 241 => 108, 229 => 100, 212 => 86, 163 => 39, 154 => 37, 145 => 34, 141 => 33, 137 => 32, 133 => 31, 129 => 29, 126 => 28, 123 => 27, 118 => 26, 114 => 25, 108 => 21, 106 => 20, 102 => 18, 99 => 17, 96 => 16, 94 => 15, 91 => 14, 89 => 13, 86 => 12, 82 => 10, 80 => 9, 75 => 6, 65 => 5, 54 => 104, 52 => 106, 39 => 104,);
}
public function getSourceContext()
{
return new Source("{#
This file is part of EC-CUBE
カスタマイズTwig
#}
{% block javascript %}
<script>
\$(function() {
{% if favorites_product_id is not empty %}
alert(\"お気に入りに追加しました。\");
{% endif %}
{% set current_domain = app.request.getHost() %}
{% set is_prod = 'web-order.shikomel.com' in current_domain %}
{% set is_stg = 'web-order-stg.shikomel.com' in current_domain %}
{% set custom_customer_id = is_granted('ROLE_USER') ? app.user.id:'' %}
// カート表示イベントの送付
{% if is_prod %}
let cartData = [];
let totalPrice = 0;
{% for Cart in Carts %}
{% for CartItem in Cart.CartItems %}
{% set ProductClass = CartItem.ProductClass %}
{% set Product = ProductClass.Product %}
cartData.push({
id: \"{{ Product.id }}\",
name: \"{{ Product.name }}\",
price: \"{{ CartItem.total_price }}\",
quantity: {{ CartItem.quantity|number_format }},
});
{% endfor %}
totalPrice = {{ Cart.totalPrice }};
{% endfor %}
if (cartData.length > 0) {
fbq('track', 'InitiateCheckout', {
content_type: \"CartInfo\",
content_ids: cartData.map(item => item.id),
content_name: cartData.map(item => item.name).join(\", \"),
contents: cartData.map(item => ({
id: item.id,
name: item.name,
quantity: item.quantity,
price: item.price
})),
currency: \"JPY\",
num_items: cartData.reduce((total, item) => total + item.quantity, 0),
value: 55
});
// Metaへイベント送付
fbq('trackCustom', 'ce_show_cart', {
content_type: \"CartInfo\",
content_ids: cartData.map(item => item.id),
content_name: cartData.map(item => item.name).join(\", \"),
contents: cartData.map(item => ({
id: item.id,
name: item.name,
quantity: item.quantity,
price: item.price
})),
currency: \"JPY\",
num_items: cartData.reduce((total, item) => total + item.quantity, 0),
value: 55
});
// GAへイベント送付
window.dataLayer.push({
event: 'ce_show_cart',
custom_event_name: 'ce_show_cart',
custom_contents: cartData.map(item => ({
id: item.id,
name: item.name,
quantity: item.quantity,
price: item.price
})),
custom_content_ids: cartData.map(item => item.id),
custom_content_names: cartData.map(item => item.name).join(\", \"),
custom_num_item: cartData.reduce((total, item) => total + item.quantity, 0),
custom_total_price: totalPrice,
custom_customer_id: '{{ custom_customer_id }}',
custom_user_agent: \$(\"#user_agent\").val(),
custom_is_ig: \$(\"#is_ig\").val(),
custom_is_line: \$(\"#is_line\").val(),
custom_referer: \$(\"#referer\").val(),
custom_real_ip: \$(\"#real_ip\").val(),
});
// Lineへイベント送付
_lt('send', 'cv', {
type: 'ce_show_cart'
},['d6fb195c-aa19-4109-8ea0-7b1d883fb349']);
}
{% endif %}
});
</script>
{% endblock %}
{% extends 'default_frame.twig' %}
{% set body_class = 'cart_page' %}
{% block stylesheet %}
<style>
.non_product {
margin-top: 24px;
text-align: center;
font-size: 14px;
margin-bottom: 24px;
}
.non_product_continue {
margin-bottom: 0px;
border-radius: 6px;
border: solid 1px #CCCCCC;
background-color: unset;
color: #525263;
font-weight: 600;
text-align: center;
cursor: pointer;
font-size: 14px;
padding: 10px 16px;
text-decoration: none;
display: block;
height: 56px;
line-height: 56px;
padding-top: 0;
padding-bottom: 0;
}
.ec-cartRole img.minus_btn_img {
width: 32px;
height: 32px;
}
.ec-cartRole img.plus_btn_img {
width: 32px;
height: 32px;
}
.ec-cartRole .quantity {
font-size: 18px;
border-bottom: solid 2px;
width: 58px;
text-align: center;
font-weight: bold;
margin-left: 8px;
margin-right: 8px;
}
.ec-cartRow__container {
display: flex;
align-items: flex-start;
}
.ec-cart-img {
margin-right: 10px;
height: 60px;
}
.ec-cartRow__unitPrice {
font-size: 14px;
}
.ec-cart-pro-info a {
font-size: 14px;
color: #1F9FCB;
font-weight: bold;
}
.separater {
background-color: #F5F5F5;
width: 100%;
}
.ec-alert-warning .ec-alert-warning__icon img {
display: inline-block;
width: 16px;
height: 16px;
}
.ec-cartRole .ec-cartRole__error .ec-alert-warning {
max-width: 100%;
display: flex;
}
.ec-alert-warning .ec-alert-warning__text {
color: #DE5D50;
font-size: 13px;
text-align: left;
font-weight: normal;
margin-top: 4px;
width: 100%;
}
.ec-alert-warning {
margin-bottom: 24px;
background: #FFF;
border-radius: 6px;
border: solid 1px #DE5D50;
text-align: left;
display: flex;
margin-right: 20px;
margin-left: 20px;
width: auto;
}
{# PC用スタイル #}
@media screen and (min-width: 1025px) {
.ec-cartRole__error {
margin: 0 auto;
padding-left: 20px;
padding-right: 20px;
max-width: 1130px;
}
hr:not([size]) {
height: 1px;
background-color: #ddd;
opacity: 1;
}
.separater {
background-color: #DDDDDD;
}
.ec-cartRow__amountUpDown {
padding-left: 145px;
}
.ec-cart-pro-info a {
font-size: 16px;
color: #1F9FCB;
}
.ec-cart-img img {
width: 130px;
height: 105px;
max-width: 130px;
margin-right: 15px;
border-radius: 4px;
}
#form_cart_frame {
display: flex;
justify-content: space-around;
}
.ec-cartRole .ec-cartRole__cart {
padding: 0px; width: 50%; margin-left: 0px; margin-right: 100px;
}
.is_pc {
display: block;
}
.is_sp {
display: none;
}
}
{# スマホ&タブレット用スタイル #}
@media screen and (max-width: 1024px) {
hr:not([size]) {
height: 8px;
background-color: #f5f5f5;
opacity: 1;
}
.separater {
background-color: #DDDDDD;
}
.ec-cart-img {
margin-right: 10px; min-width: 74px;
}
.ec-cart-img img {
width: 74px;
height: 60px;
border-radius: 4px;
}
.is_pc {
display: none;
}
.is_sp {
display: block;
}
}
</style>
{% endblock %}
{% block main %}
<div class=\"ec-role\">
<div class=\"ec-pageHeader\">
<h1 style=\"border-top: none; padding: 12px 0 12px; margin-bottom: 8px;\">{{ 'カート'|trans }}</h1>
</div>
</div>
{% set productStr = app.session.flashbag.get('eccube.front.request.product') %}
{% for error in app.session.flashbag.get('eccube.front.request.error') %}
{% set idx = loop.index0 %}
<div class=\"ec-cartRole__error\">
<div class=\"ec-alert-warning\">
<div class=\"ec-alert-warning__icon\"><img src=\"{{ asset('assets/img/common/alert_icon.png', 'user_data') }}\"></div>
<div class=\"ec-alert-warning__text\">
{% if productStr[idx] is defined %}
{{ error|trans({'%product%':productStr[idx]})|nl2br }}
{% else %}
{{ error|trans|nl2br }}
{% endif %}
</div>
</div>
</div>
{% endfor %}
{% for error in app.session.flashbag.get('eccube.front.cart.error') %}
<div class=\"ec-cartRole__error\">
<div class=\"ec-alert-warning\">
<div class=\"ec-alert-warning__icon\"><img src=\"{{ asset('assets/img/common/alert_icon.png', 'user_data') }}\"></div>
<div class=\"ec-alert-warning__text\">
{{ error|trans|nl2br }}
</div>
</div>
</div>
{% endfor %}
<div class=\"ec-cartRole\" style=\"padding: 0px; display: block;\">
{% if totalQuantity > 0 %}
{% if Carts|length > 1 %}
<div class=\"ec-cartRole__error\">
<div class=\"ec-alert-warning\">
<div class=\"ec-alert-warning__text\">
{{ '同時購入できない商品がカートに含まれています。'|trans|nl2br }}
</div>
</div>
</div>
{% endif %}
<form name=\"form\" id=\"form_cart\" method=\"post\" action=\"{{ url('cart') }}\">
{% for CartIndex,Cart in Carts %}
{% set cartKey = Cart.cart_key %}
{% for error in app.session.flashbag.get('eccube.front.cart.' ~ cartKey ~ '.request.error') %}
<div class=\"ec-cartRole__error\">
<div class=\"ec-alert-warning\">
<div class=\"ec-alert-warning__icon\"><img src=\"{{ asset('assets/img/common/alert_icon.png', 'user_data') }}\"></div>
<div class=\"ec-alert-warning__text\">
{{ error|trans|nl2br }}
</div>
</div>
</div>
{% endfor %}
<div id=\"form_cart_frame\">
<div class=\"ec-cartRole__cart\" style=\"\">
<div class=\"\">
{% for CartItem in Cart.CartItems %}
{% set ProductClass = CartItem.ProductClass %}
{% set Product = ProductClass.Product %}
<div style=\"padding-right: 16px; padding-left: 16px;\">
<div style=\"margin-top: 20px;\">
<div class=\"ec-cartRow__container\" style=\"display: flex; align-items: flex-start;\">
<div class=\"ec-cart-img\" style=\"\">
<a target=\"_blank\" href=\"{{ url('product_detail', {id : Product.id} ) }}\">
<img src=\"{{ asset(Product.MainListImage|no_image_product, 'save_image') }}\" alt=\"{{ Product.name }}\"/>
</a>
</div>
<div class=\"ec-cart-pro-info\">
<div class=\"ec-cartRow__name\" style=\"line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;\">
<a target=\"_blank\" style=\"\" href=\"{{ url('product_detail', {id : Product.id} ) }}\">
{{ Product.name }}
</a>
</div>
<div class=\"ec-cartRow__unitPrice\" style=\"margin-top: 5px;\">{{ CartItem.price|number_format }}円
{% if Product.standard_text %}({{ Product.standard_text }}){% endif %}
</div>
</div>
</div>
</div>
<div style=\"display: flex; margin-top: 8px;
{% if not CartItem.ProductClass.Product.is_recipe_book %}
justify-content: space-between;
{% else %}
justify-content: end;
{% endif %}
align-items: flex-end;\">
{# レシピ帖の場合には数量のアップダウンは非表示 #}
{% if not CartItem.ProductClass.Product.is_recipe_book %}
<div class=\"ec-cartRow__amountUpDown\" style=\"display: flex;\">
{% if CartItem.quantity > 1 %}
<a class=\"plus_btn\" href=\"{{ url('cart_handle_item', {'operation': 'down', 'productClassId': ProductClass.id}) }}\" {{ csrf_token_for_anchor() }} class=\"ec-cartRow__amountDownButton load-overlay\" data-method=\"put\" data-confirm=\"false\">
<span class=\"ec-cartRow__amountDownButton__icon\">
<img src=\"{{ asset('assets/img/common/minus_btn.png', 'user_data') }}\" alt=\"reduce\" class=\"minus_btn_img\">
</span>
</a>
{% else %}
<div class=\"ec-cartRow__amountDownButtonDisabled\">
<span class=\"ec-cartRow__amountDownButton__icon\">
<img src=\"{{ asset('assets/img/common/minus_btn_disabled.png', 'user_data') }}\" alt=\"reduce\" class=\"minus_btn_img\">
</span>
</div>
{% endif %}
<div class=\"quantity\">{{ CartItem.quantity|number_format }}</div>
<a href=\"{{ url('cart_handle_item', {'operation': 'up', 'productClassId': ProductClass.id}) }}\" {{ csrf_token_for_anchor() }} class=\"ec-cartRow__amountUpButton load-overlay\" data-method=\"put\" data-confirm=\"false\">
<span class=\"ec-cartRow__amountUpButton__icon\">
<img src=\"{{ asset('assets/img/common/plus_btn.png', 'user_data') }}\" alt=\"increase\" class=\"plus_btn_img\">
</span>
</a>
</div>
{% endif %}
<div class=\"ec-cartRow__sutbtotalSP\">
<span style=\"font-size: 14px;\">小計</span>
<span style=\"font-size: 20px; font-weight: bold;\">{{ CartItem.total_price|number_format }}</span>
<span style=\"font-size: 14px;\">円</span>
<span style=\"font-size: 14px;\">(税込)</span>
</div>
</div>
<div style=\"text-align: right; margin-top: 14px;\">
{% if is_granted('ROLE_USER') %}
<a href=\"{{ url('product_add_favorite', {id:Product.id}) }}\" class=\"ec-icon\" data-method=\"post\">
<span style=\"font-size: 14px; text-decoration: underline; color: #525263; margin-right: 20px;\">お気に入りに追加</span>
</a>
{% endif %}
<a href=\"{{ url('cart_handle_item', {'operation': 'remove', 'productClassId': ProductClass.id }) }}\" {{ csrf_token_for_anchor() }} class=\"ec-icon\" data-method=\"put\" data-message=\"カートから商品を削除してもよろしいですか?\">
<span style=\"font-size: 14px; text-decoration: underline; color: #525263;\">削除</span>
</a>
</div>
</div>
<hr class=\"separater\" style=\"\">
{% endfor %}
</div>
</div>
<div class=\"ec-cartRole__actions\" style=\"padding-right: 16px; padding-left: 16px; margin-right: 0px; width: 375px;\">
<div style=\"position: sticky; top: 50px;\">
<div class=\"ec-cartRole__total\" style=\"display: flex; justify-content: space-between; align-items: center; height: 36px; margin: 16px 0px; padding: 0px;\">
<span style=\"font-size: 18px; font-weight: bold;\">
合計金額<span style=\"font-size: 14px; font-weight: normal;\">({{ Cart.CartItems|length }}商品)</span>
</span>
<span class=\"ec-cartRole__totalAmount\" style=\"font-size: 24px; font-weight: bold;\">
{{ Cart.totalPrice|number_format }}
<span style=\"font-size: 14px; font-weight: bold;\">円(税込)</span>
</span>
</div>
{# PCもSPもクーポンあればバナー表示するように修正 #}
{% if isShowCouponCode is defined and isShowCouponCode %}
<div class=\"\" style=\"margin: auto;\">
<img src=\"{{ asset('assets/img/common/has_3000_coupon_cart.png', 'user_data') }}\" style=\"padding: 0px 10px;\">
</div>
{% endif %}
<a class=\"ec-blockBtn--action\" style=\"max-width: 343px; margin: auto; background-color: #DE5D50; border-color: #DE5D50;\" href=\"{{ url('shopping_nonmember') }}\">{{ 'ご注文手続きへ'|trans }}</a>
{% if loop.last %}
<div style=\"text-align: center; margin-bottom: 16px; margin-top: 16px; line-height: 39px;\">
<a style=\"color: #1F9FCB;\" href=\"{{ path('homepage') }}\">{{ 'お買い物を続ける'|trans }}</a>
</div>
{% endif %}
</div>
</div>
{% endfor %}
</div>
</form>
{% else %}
{% for CartIndex,Cart in Carts %}
{% set cartKey = Cart.cart_key %}
{% for error in app.session.flashbag.get('eccube.front.cart.' ~ cartKey ~ '.request.error') %}
<div class=\"ec-cartRole__error\">
<div class=\"ec-alert-warning\">
<div class=\"ec-alert-warning__icon\"><img src=\"{{ asset('assets/icon/exclamation-white.svg') }}\"></div>
<div class=\"ec-alert-warning__text\">
{{ error|trans|nl2br }}
</div>
</div>
</div>
{% endfor %}
{% endfor %}
<div class=\"ec-role\">
<div class=\"ec-off3Grid\">
<div class=\"ec-off3Grid__cell\">
<div class=\"non_product\">{{ 'カートに商品がありません。'|trans }}</div>
<div style=\"margin-bottom: 24px;\">
<a class=\"non_product_continue\" href=\"{{ path('homepage') }}\">{{ 'お買い物を続ける'|trans }}</a>
</div>
</div>
</div>
</div>
{% endif %}
</div>
{% endblock %}
", "Cart/index.twig", "/home/shikomel/shikomel.com/public_html/web-order-stg.shikomel.com/app/template/default/Cart/index.twig");
}
public function checkSecurity()
{
static $tags = array("set" => 106, "if" => 9, "for" => 25);
static $filters = array("escape" => 31, "number_format" => 34, "trans" => 305, "nl2br" => 318, "length" => 340, "no_image_product" => 375);
static $functions = array("is_granted" => 17, "asset" => 315, "url" => 350, "csrf_token_for_anchor" => 402, "path" => 467);
try {
$this->sandbox->checkSecurity(
['set', 'if', 'for'],
['escape', 'number_format', 'trans', 'nl2br', 'length', 'no_image_product'],
['is_granted', 'asset', 'url', 'csrf_token_for_anchor', 'path']
);
} 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;
}
}
}