<?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_73f539ef3b12e6226a3470fb8d12d683 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'],
'main' => [$this, 'block_main'],
];
$this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension');
$this->checkSecurity();
}
protected function doGetParent(array $context)
{
// line 11
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 13
$context["body_class"] = "cart_page";
// line 11
$this->parent = $this->loadTemplate("default_frame.twig", "Cart/index.twig", 11);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 15
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 16
echo " <script>
\$(function() {
var cnt = \$('.ec-cartRow').length;
for (let i = 0; i < cnt; i++){
// Get the data-prototype explained earlier
var prototype = \$('.cartitems').data('prototype');
// get the new index
var index = \$('.cartitems').data('index');
// Replace '__name__' in the prototype's HTML to
// instead be a number based on how many items we have
var newForm = '<div class=\"mt-3 pb-0 d-flex flex-wrap justify-content-between\"><span>オプションを選択してください。</span><span>オプション小計:<span><span class=\"item_option_price_' + index + '\">¥0</span></span><small>(税込)</small></span></div>';
newForm += '<div class=\"mt-2 mb-3 p-3 bg-white cart_option\" id=\"cart_option_' + index + '\">';
newForm += prototype.replace(/__name__/g, index);
newForm += '<div class=\"d-flex flex-column flex-md-row\"><span class=\"w_120\"></span><span>インサイド石は、刻印がある場合は刻印の直後にセッティングさせていただきます。<br>';
newForm += '石の位置の変更をご希望の場合は購入手続き画面のお問い合わせ欄にご記入ください。</span></p>';
newForm += '</div>';
// increase the index with one for the next item
\$('.cartitems').data('index', index + 1);
// Display the form in the page before the \"new\" link
//\$(this).before(newForm);
var add = \".add_option_\" + i;
// ID119の商品はオプションを表示しない
// 結婚指輪でも婚約指輪でもない場合はオプションを表示しない
if (\$(add).hasClass('itemid_119') || \$(add).hasClass('itemcat_0')) {
newForm = '<hr><div class=\"d-none\">' + newForm + '</div>';
}
\$(add).before(newForm);
}
// 刻印文字数の注意書き追加
\$('input[id\$=\"engraving_text\"]').each(function () {
\$(this).parent().addClass('flex-wrap');
\$(this).after('<p class=\"w-100 engraving_text_notice\">刻印できる文字数は最大19文字です。</p>')
});
// 読み込み時 すでに値があったら表示する
";
// line 54
$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.', 54, $this->source); })()));
foreach ($context['_seq'] as $context["CartIndex"] => $context["Cart"]) {
// line 55
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["Cart"], "CartItems", [], "any", false, false, true, 55));
$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["CartItem"]) {
// line 56
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["CartItem"], "engraving", [], "any", false, false, true, 56) == "あり")) {
// line 57
echo " \$('input[name=\"form[data][' + ";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["loop"], "index0", [], "any", false, false, true, 57), 57, $this->source), "html", null, true);
echo " + '][engraving]\"]').val([\"あり\"]);
\$('#form_data_' + ";
// line 58
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["loop"], "index0", [], "any", false, false, true, 58), 58, $this->source), "html", null, true);
echo " + ' > div').css('display','flex');
\$('#form_data_' + ";
// line 59
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["loop"], "index0", [], "any", false, false, true, 59), 59, $this->source), "html", null, true);
echo " + ' fieldset:nth-child(2)').css('display','flex');
";
}
// line 61
echo " ";
if ( !(null === twig_get_attribute($this->env, $this->source, $context["CartItem"], "engraving_font", [], "any", false, false, true, 61))) {
// line 62
echo " \$('input[name=\"form[data][' + ";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["loop"], "index0", [], "any", false, false, true, 62), 62, $this->source), "html", null, true);
echo " + '][engraving_font]\"]').val([\"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["CartItem"], "engraving_font", [], "any", false, false, true, 62), 62, $this->source), "html", null, true);
echo "\"]);
";
}
// line 64
echo " ";
if ( !(null === twig_get_attribute($this->env, $this->source, $context["CartItem"], "engraving_text", [], "any", false, false, true, 64))) {
// line 65
echo " \$('input[name=\"form[data][' + ";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["loop"], "index0", [], "any", false, false, true, 65), 65, $this->source), "html", null, true);
echo " + '][engraving_text]\"]').val(\"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["CartItem"], "engraving_text", [], "any", false, false, true, 65), 65, $this->source), "html", null, true);
echo "\");
";
}
// line 67
echo " ";
if (((twig_get_attribute($this->env, $this->source, $context["CartItem"], "stone", [], "any", false, false, true, 67) != "なし") && !(null === twig_get_attribute($this->env, $this->source, $context["CartItem"], "stone", [], "any", false, false, true, 67)))) {
// line 68
echo " \$('input[name=\"form[data][' + ";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["loop"], "index0", [], "any", false, false, true, 68), 68, $this->source), "html", null, true);
echo " + '][stone]\"]').val([\"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["CartItem"], "stone", [], "any", false, false, true, 68), 68, $this->source), "html", null, true);
echo "\"]);
";
}
// line 70
echo " ";
++$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['CartItem'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 71
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 72
echo " var cnt = \$('.ec-cartRow').length;
for (let i = 0; i < cnt; i++) {
var cart_option = document.getElementById(\"cart_option_\" + i);
if (cart_option === null) {
} else {
if (\$('input[name=\"form[data][' + i + '][engraving]\"]:checked').val() == \"あり\") { // 刻印あり
\$('#form_data_' + i + ' > div').css('display','flex');
\$('#form_data_' + i + ' fieldset:nth-child(2)').css('display','flex');
if (\$('input[name=\"form[data][' + i + '][engraving_font]\"]:checked').val() == null) {
\$('.action_btn_wrapper').addClass('not_available');
go = false;
} else if (!\$('input[name=\"form[data][' + i + '][engraving_text]\"]').val()) {
\$('.action_btn_wrapper').addClass('not_available');
go = false;
}
} else if (\$('input[name=\"form[data][' + i + '][engraving]\"]:checked').val() == \"なし\") {
\$('input[name=\"form[data][' + i + '][engraving_font]\"]:checked').prop('checked', false);
\$('#form_data_' + i + ' > div').css('display','none');
\$('#form_data_' + i + ' fieldset:nth-child(2)').css('display','none');
}
}
}
checkEngraving();
calcTotal();
// cart_key と cart_id をセット
var cnt = \$('.ec-cartRow').length;
for (let i = 0; i < cnt; i++) {
\$('input[name=\"form[data][' + i + '][cart_key]\"]').val(\$('#ck_0').text()); // cartkey は同じカートなら同じ
\$('input[name=\"form[data][' + i + '][cart_item_id]\"]').val(\$('#ciid_' + i).text());
}
\$('.form-check-input').on('change', function(event) {
checkEngraving();
calcTotal();
});
\$('input[id\$=\"engraving_text\"]').on('keyup', function(event) {
let count = \$(this).val().length;
if (count > 19){
if (!\$(this).parent().prev().hasClass('text_count_message')) {
\$(this).parent().before('<p class=\"mb-2 text_count_message text-danger\">※刻印は19文字までです</p>');
\$('.action_btn_wrapper').addClass('not_available');
}
} else {
if (\$(this).parent().prev().hasClass('text_count_message')) {
\$(this).parent().prev('.text_count_message').remove();
}
}
});
\$('.form-control').on('change', function(event) {
checkEngraving();
});
function checkEngraving() {
var cnt = \$('.ec-cartRow').length;
var go = true;
for (let i = 0; i < cnt; i++) {
var cart_option = document.getElementById(\"cart_option_\" + i);
if (cart_option === null) {
} else {
if (\$('input[name=\"form[data][' + i + '][engraving]\"]:checked').val() == \"あり\") { // 刻印あり
\$('#form_data_' + i + ' > div').css('display','flex');
\$('#form_data_' + i + ' fieldset:nth-child(2)').css('display','flex');
if (\$('input[name=\"form[data][' + i + '][engraving_font]\"]:checked').val() == null) {
\$('.action_btn_wrapper').addClass('not_available');
go = false;
} else if (!\$('input[name=\"form[data][' + i + '][engraving_text]\"]').val()) {
\$('.action_btn_wrapper').addClass('not_available');
go = false;
}
} else if (\$('input[name=\"form[data][' + i + '][engraving]\"]:checked').val() == \"なし\") {
\$('input[name=\"form[data][' + i + '][engraving_font]\"]:checked').prop('checked', false);
\$('#form_data_' + i + ' > div').css('display','none');
\$('#form_data_' + i + ' fieldset:nth-child(2)').css('display','none');
}
}
}
if (go) {
\$('.action_btn_wrapper').removeClass('not_available');
}
}
function calcTotal() {
var cnt = \$('.ec-cartRow').length;
var option_total = 0;
for (let i = 0; i < cnt; i++) {
var item_option_price = 0;
var cart_option = document.getElementById(\"cart_option_\" + i);
if (cart_option === null) {
} else {
if (\$('input[name=\"form[data][' + i + '][engraving]\"]:checked').val() == \"あり\") {
//item_option_price += 5500;
}
switch (\$('input[name=\"form[data][' + i + '][engraving_font]\"]:checked').val()) {
case \"有料書体1\":
case \"有料書体2\":
case \"有料書体3\":
case \"有料書体4\":
case \"有料書体5\":
case \"有料書体6\":
case \"有料書体7\":
case \"有料書体8\":
case \"有料書体9\":
case \"有料書体10\":
item_option_price += 5500;
break;
default:
}
switch (\$('input[name=\"form[data][' + i + '][stone]\"]:checked').val()) {
case \"なし\":
break;
default:
// 一律料金?
item_option_price += 5500;
}
}
var item_option_total_price = String(item_option_price).replace(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/g, '\$1,');
\$('.item_option_price_' + i).text(\"¥\" + item_option_total_price);
\$('input[name=\"form[data][' + i + '][option_total_price]\"]').val(item_option_price);
option_total += item_option_price;
}
var option_total_price = String(option_total).replace(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/g, '\$1,');
\$('#option_total').text(\"¥\" + option_total_price);
// 総合計更新
var total_price = \$('#price_total_tmp').text();
total_price = total_price * 1; //number
total_price += option_total;
var cart_total_price = String(total_price).replace(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/g, '\$1,');
\$('#cart_total').text(\"¥\" + cart_total_price);
}
\$('.ec-blockBtn--action').on('click', function(event) {
calcTotal();
});
});
</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 211
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 212
echo " <div class=\"ec-role\">
<div class=\"ec-pageHeader\">
<h1>";
// line 214
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ショッピングカート"), "html", null, true);
echo "</h1>
</div>
</div>
<div class=\"ec-cartRole\">
<div class=\"ec-cartRole__progress\">
<ul class=\"ec-progress\">
";
// line 221
$context["step"] = 1;
// line 222
echo " <li class=\"ec-progress__item is-complete\">
<div class=\"ec-progress__number\">";
// line 223
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["step"]) || array_key_exists("step", $context) ? $context["step"] : (function () { throw new RuntimeError('Variable "step" does not exist.', 223, $this->source); })()), 223, $this->source), "html", null, true);
$context["step"] = ((isset($context["step"]) || array_key_exists("step", $context) ? $context["step"] : (function () { throw new RuntimeError('Variable "step" does not exist.', 223, $this->source); })()) + 1);
// line 224
echo " </div>
<div class=\"ec-progress__label\">";
// line 225
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートの商品"), "html", null, true);
echo "
</div>
</li>
";
// line 228
if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_USER") == false)) {
// line 229
echo " <li class=\"ec-progress__item\">
<div class=\"ec-progress__number\">";
// line 230
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["step"]) || array_key_exists("step", $context) ? $context["step"] : (function () { throw new RuntimeError('Variable "step" does not exist.', 230, $this->source); })()), 230, $this->source), "html", null, true);
$context["step"] = ((isset($context["step"]) || array_key_exists("step", $context) ? $context["step"] : (function () { throw new RuntimeError('Variable "step" does not exist.', 230, $this->source); })()) + 1);
// line 231
echo " </div>
<div class=\"ec-progress__label\">";
// line 232
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("お客様情報"), "html", null, true);
echo "
</div>
</li>
";
}
// line 236
echo " <li class=\"ec-progress__item\">
<div class=\"ec-progress__number\">";
// line 237
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["step"]) || array_key_exists("step", $context) ? $context["step"] : (function () { throw new RuntimeError('Variable "step" does not exist.', 237, $this->source); })()), 237, $this->source), "html", null, true);
$context["step"] = ((isset($context["step"]) || array_key_exists("step", $context) ? $context["step"] : (function () { throw new RuntimeError('Variable "step" does not exist.', 237, $this->source); })()) + 1);
// line 238
echo " </div>
<div class=\"ec-progress__label\">";
// line 239
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ご注文手続き"), "html", null, true);
echo "
</div>
</li>
<li class=\"ec-progress__item\">
<div class=\"ec-progress__number\">";
// line 243
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["step"]) || array_key_exists("step", $context) ? $context["step"] : (function () { throw new RuntimeError('Variable "step" does not exist.', 243, $this->source); })()), 243, $this->source), "html", null, true);
$context["step"] = ((isset($context["step"]) || array_key_exists("step", $context) ? $context["step"] : (function () { throw new RuntimeError('Variable "step" does not exist.', 243, $this->source); })()) + 1);
// line 244
echo " </div>
<div class=\"ec-progress__label\">";
// line 245
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ご注文内容確認"), "html", null, true);
echo "
</div>
</li>
<li class=\"ec-progress__item\">
<div class=\"ec-progress__number\">";
// line 249
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["step"]) || array_key_exists("step", $context) ? $context["step"] : (function () { throw new RuntimeError('Variable "step" does not exist.', 249, $this->source); })()), 249, $this->source), "html", null, true);
$context["step"] = ((isset($context["step"]) || array_key_exists("step", $context) ? $context["step"] : (function () { throw new RuntimeError('Variable "step" does not exist.', 249, $this->source); })()) + 1);
// line 250
echo " </div>
<div class=\"ec-progress__label\">";
// line 251
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("完了"), "html", null, true);
echo "
</div>
</li>
</ul>
</div>
";
// line 256
$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.', 256, $this->source); })()), "session", [], "any", false, false, true, 256), "flashbag", [], "any", false, false, true, 256), "get", [0 => "eccube.front.request.product"], "method", false, false, true, 256);
// line 257
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.', 257, $this->source); })()), "session", [], "any", false, false, true, 257), "flashbag", [], "any", false, false, true, 257), "get", [0 => "eccube.front.request.error"], "method", false, false, true, 257));
$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 258
echo " ";
$context["idx"] = twig_get_attribute($this->env, $this->source, $context["loop"], "index0", [], "any", false, false, true, 258);
// line 259
echo " <div class=\"ec-cartRole__error\">
<div class=\"ec-alert-warning\">
<div class=\"ec-alert-warning__icon\"><img src=\"";
// line 261
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 263
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.', 263, $this->source); })()), [], "array", true, true, true, 263)) {
// line 264
echo " ";
echo twig_nl2br(twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($this->sandbox->ensureToStringAllowed($context["error"], 264, $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.', 264, $this->source); })()), (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 264, $this->source); })()), [], "array", false, false, true, 264)]), "html", null, true));
echo "
";
} else {
// line 266
echo " ";
echo twig_nl2br(twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($this->sandbox->ensureToStringAllowed($context["error"], 266, $this->source)), "html", null, true));
echo "
";
}
// line 268
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 272
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.', 272, $this->source); })()), "session", [], "any", false, false, true, 272), "flashbag", [], "any", false, false, true, 272), "get", [0 => "eccube.front.cart.error"], "method", false, false, true, 272));
foreach ($context['_seq'] as $context["_key"] => $context["error"]) {
// line 273
echo " <div class=\"ec-cartRole__error\">
<div class=\"ec-alert-warning\">
<div class=\"ec-alert-warning__icon\"><img src=\"";
// line 275
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 277
echo twig_nl2br(twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($this->sandbox->ensureToStringAllowed($context["error"], 277, $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 282
echo " ";
if (((isset($context["totalQuantity"]) || array_key_exists("totalQuantity", $context) ? $context["totalQuantity"] : (function () { throw new RuntimeError('Variable "totalQuantity" does not exist.', 282, $this->source); })()) > 0)) {
// line 283
echo " <!--<div class=\"ec-cartRole__totalText\">
<p>
";
// line 285
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("商品の合計金額は「<strong>%price%</strong>」です。", ["%price%" => $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.', 285, $this->source); })()), 285, $this->source))]);
echo "
</p>
</div>-->
";
// line 288
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.', 288, $this->source); })())) > 1)) {
// line 289
echo " <div class=\"ec-cartRole__error\">
<div class=\"ec-alert-warning\">
<div class=\"ec-alert-warning__text\">
";
// line 292
echo twig_nl2br(twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("同時購入できない商品がカートに含まれています。"), "html", null, true));
echo "
</div>
</div>
</div>
";
}
// line 297
echo "
";
// line 299
echo " <form name=\"form\" id=\"form_cart\" class=\"ec-cartRole\" method=\"post\" action=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("cart_add_option");
echo "\">
<div class=\"cartitems\" data-prototype=\"";
// line 300
echo twig_escape_filter($this->env, $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock($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["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 300, $this->source); })()), "data", [], "any", false, false, true, 300), "vars", [], "any", false, false, true, 300), "prototype", [], "any", false, false, true, 300), 300, $this->source), 'widget'), "html_attr");
echo "\" data-index=0></div>
";
// line 302
$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.', 302, $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 303
echo " ";
$context["cartKey"] = twig_get_attribute($this->env, $this->source, $context["Cart"], "cart_key", [], "any", false, false, true, 303);
// line 304
echo " <span id=\"ck_";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["loop"], "index0", [], "any", false, false, true, 304), 304, $this->source), "html", null, true);
echo "\" class=\"d-none\">";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["cartKey"]) || array_key_exists("cartKey", $context) ? $context["cartKey"] : (function () { throw new RuntimeError('Variable "cartKey" does not exist.', 304, $this->source); })()), 304, $this->source), "html", null, true);
echo "</span>
";
// line 306
$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.', 306, $this->source); })()), "session", [], "any", false, false, true, 306), "flashbag", [], "any", false, false, true, 306), "get", [0 => (("eccube.front.cart." . (isset($context["cartKey"]) || array_key_exists("cartKey", $context) ? $context["cartKey"] : (function () { throw new RuntimeError('Variable "cartKey" does not exist.', 306, $this->source); })())) . ".request.error")], "method", false, false, true, 306));
foreach ($context['_seq'] as $context["_key"] => $context["error"]) {
// line 307
echo " <div class=\"ec-cartRole__error\">
<div class=\"ec-alert-warning\">
<div class=\"ec-alert-warning__icon\"><img src=\"";
// line 309
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 311
echo twig_nl2br(twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($this->sandbox->ensureToStringAllowed($context["error"], 311, $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 316
echo "
<div class=\"ec-cartRole__cart\">
<!--<div class=\"ec-cartTable\">
<ol class=\"ec-cartHeader\">
<li class=\"ec-cartHeader__label\">";
// line 320
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("削除"), "html", null, true);
echo "</li>
<li class=\"ec-cartHeader__label\">";
// line 321
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("商品内容"), "html", null, true);
echo "</li>
<li class=\"ec-cartHeader__label\">";
// line 322
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("数量"), "html", null, true);
echo "</li>
<li class=\"ec-cartHeader__label\">";
// line 323
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("小計"), "html", null, true);
echo "</li>
</ol>-->
";
// line 325
$context["item_cnt"] = 0;
// line 326
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["Cart"], "CartItems", [], "any", false, false, true, 326));
$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["CartItem"]) {
// line 327
echo " <span id=\"ciid_";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["loop"], "index0", [], "any", false, false, true, 327), 327, $this->source), "html", null, true);
echo "\" class=\"d-none\">";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["CartItem"], "id", [], "any", false, false, true, 327), 327, $this->source), "html", null, true);
echo "</span>
";
// line 329
$context["ProductClass"] = twig_get_attribute($this->env, $this->source, $context["CartItem"], "ProductClass", [], "any", false, false, true, 329);
// line 330
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.', 330, $this->source); })()), "Product", [], "any", false, false, true, 330);
// line 331
echo " <div class=\"ec-cartTable\">
";
// line 332
if ((twig_get_attribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, true, 332) == 1)) {
// line 333
echo " <ol class=\"ec-cartHeader\">
<li class=\"ec-cartHeader__label\">";
// line 334
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("削除"), "html", null, true);
echo "</li>
<li class=\"ec-cartHeader__label\">";
// line 335
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("商品内容"), "html", null, true);
echo "</li>
<li class=\"ec-cartHeader__label\">";
// line 336
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("数量"), "html", null, true);
echo "</li>
<li class=\"ec-cartHeader__label\">";
// line 337
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("小計"), "html", null, true);
echo "</li>
</ol>
";
}
// line 340
echo "
<ul class=\"ec-cartRow cartitem cartitem_";
// line 341
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["item_cnt"]) || array_key_exists("item_cnt", $context) ? $context["item_cnt"] : (function () { throw new RuntimeError('Variable "item_cnt" does not exist.', 341, $this->source); })()), 341, $this->source), "html", null, true);
echo "\">
<li class=\"ec-cartRow__delColumn\">
";
// line 344
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, $context["CartItem"], "id", [], "any", false, false, true, 344)]), "html", null, true);
echo "\" ";
echo $this->extensions['Eccube\Twig\Extension\CsrfExtension']->getCsrfTokenForAnchor();
echo " class=\"ec-icon\" data-method=\"put\" data-message=\"カートから商品を削除してもよろしいですか?\">
<img src=\"";
// line 345
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/icon/cross.svg"), "html", null, true);
echo "\" alt=\"delete\">
</a>
</li>
<li class=\"ec-cartRow__contentColumn\">
<div class=\"ec-cartRow__img\">
<a target=\"_blank\" href=\"";
// line 350
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.', 350, $this->source); })()), "id", [], "any", false, false, true, 350)]), "html", null, true);
echo "\">
<img src=\"";
// line 351
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.', 351, $this->source); })()), "MainListImage", [], "any", false, false, true, 351), 351, $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.', 351, $this->source); })()), "name", [], "any", false, false, true, 351), 351, $this->source), "html", null, true);
echo "\"/>
</a>
</div>
<div class=\"ec-cartRow__summary\">
<div class=\"ec-cartRow__name\">
<a target=\"_blank\" href=\"";
// line 356
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.', 356, $this->source); })()), "id", [], "any", false, false, true, 356)]), "html", null, true);
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.', 356, $this->source); })()), "name", [], "any", false, false, true, 356), 356, $this->source), "html", null, true);
echo "</a>
";
// line 357
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.', 357, $this->source); })()), "ClassCategory1", [], "any", false, false, true, 357) && 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.', 357, $this->source); })()), "ClassCategory1", [], "any", false, false, true, 357), "id", [], "any", false, false, true, 357))) {
// line 358
echo " ";
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.', 358, $this->source); })()), "id", [], "any", false, false, true, 358) != 119)) {
// line 359
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.', 359, $this->source); })()), "ClassCategory1", [], "any", false, false, true, 359), "ClassName", [], "any", false, false, true, 359), "name", [], "any", false, false, true, 359), 359, $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.', 359, $this->source); })()), "ClassCategory1", [], "any", false, false, true, 359), 359, $this->source), "html", null, true);
echo "
";
}
// line 361
echo " ";
}
// line 362
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.', 362, $this->source); })()), "ClassCategory2", [], "any", false, false, true, 362) && 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.', 362, $this->source); })()), "ClassCategory2", [], "any", false, false, true, 362), "id", [], "any", false, false, true, 362))) {
// line 363
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.', 363, $this->source); })()), "ClassCategory2", [], "any", false, false, true, 363), "ClassName", [], "any", false, false, true, 363), "name", [], "any", false, false, true, 363), 363, $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.', 363, $this->source); })()), "ClassCategory2", [], "any", false, false, true, 363), 363, $this->source), "html", null, true);
echo "
";
}
// line 365
echo " ";
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.', 365, $this->source); })()), "id", [], "any", false, false, true, 365) != 119)) {
// line 366
echo " ";
if (twig_get_attribute($this->env, $this->source, $context["CartItem"], "size", [], "any", false, false, true, 366)) {
echo " サイズ:";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["CartItem"], "size", [], "any", false, false, true, 366), 366, $this->source), "html", null, true);
echo "号";
}
// line 367
echo " ";
}
// line 368
echo " </div>
<!--<div class=\"ec-cartRow__unitPrice\">";
// line 369
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, 369), 369, $this->source)), "html", null, true);
echo "</div>-->
";
// line 370
$context["sum"] = (twig_get_attribute($this->env, $this->source, $context["CartItem"], "total_price", [], "any", false, false, true, 370) + twig_get_attribute($this->env, $this->source, $context["CartItem"], "size_price", [], "any", false, false, true, 370));
// line 371
echo " <div class=\"ec-cartRow__sutbtotalSP\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("小計:"), "html", null, true);
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed((isset($context["sum"]) || array_key_exists("sum", $context) ? $context["sum"] : (function () { throw new RuntimeError('Variable "sum" does not exist.', 371, $this->source); })()), 371, $this->source)), "html", null, true);
echo "</div>
</div>
</li>
<li class=\"ec-cartRow__amountColumn\">
<div class=\"ec-cartRow__amount\">";
// line 375
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, 375), 375, $this->source)), "html", null, true);
echo "</div>
<div class=\"ec-cartRow__amountSP\">";
// line 376
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("数量:"), "html", null, true);
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, 376), 376, $this->source)), "html", null, true);
echo "</div>
<div class=\"ec-cartRow__amountUpDown\">
";
// line 390
echo " </div>
</li>
<li class=\"ec-cartRow__subtotalColumn\">
<div class=\"ec-cartRow__sutbtotal\">";
// line 393
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed((isset($context["sum"]) || array_key_exists("sum", $context) ? $context["sum"] : (function () { throw new RuntimeError('Variable "sum" does not exist.', 393, $this->source); })()), 393, $this->source)), "html", null, true);
echo "<small>(税込)</small></div>
</li>
</ul>
</div>
";
// line 397
$context["category"] = 0;
// line 398
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(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.', 398, $this->source); })()), "ProductCategories", [], "any", false, false, true, 398));
foreach ($context['_seq'] as $context["_key"] => $context["ProductCategory"]) {
// line 399
echo " ";
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["ProductCategory"], "Category", [], "any", false, false, true, 399), "id", [], "any", false, false, true, 399) == 1)) {
// line 400
echo " ";
// line 401
echo " ";
$context["category"] = 1;
// line 402
echo " ";
} elseif ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["ProductCategory"], "Category", [], "any", false, false, true, 402), "id", [], "any", false, false, true, 402) == 2)) {
// line 403
echo " ";
// line 404
echo " ";
$context["category"] = 2;
// line 405
echo " ";
}
// line 406
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ProductCategory'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 407
echo " <a href=\"#\" class=\"add_option add_option_";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["item_cnt"]) || array_key_exists("item_cnt", $context) ? $context["item_cnt"] : (function () { throw new RuntimeError('Variable "item_cnt" does not exist.', 407, $this->source); })()), 407, $this->source), "html", null, true);
echo " itemid_";
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.', 407, $this->source); })()), "id", [], "any", false, false, true, 407), 407, $this->source), "html", null, true);
echo " itemcat_";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 407, $this->source); })()), 407, $this->source), "html", null, true);
echo " d-none\"></a>
";
// line 408
$context["item_cnt"] = ((isset($context["item_cnt"]) || array_key_exists("item_cnt", $context) ? $context["item_cnt"] : (function () { throw new RuntimeError('Variable "item_cnt" does not exist.', 408, $this->source); })()) + 1);
// line 409
echo " ";
++$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['CartItem'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 410
echo " </div>
<div class=\"ec-cartRole__progress\">
";
// line 413
if ((twig_get_attribute($this->env, $this->source, (isset($context["BaseInfo"]) || array_key_exists("BaseInfo", $context) ? $context["BaseInfo"] : (function () { throw new RuntimeError('Variable "BaseInfo" does not exist.', 413, $this->source); })()), "delivery_free_amount", [], "any", false, false, true, 413) && twig_get_attribute($this->env, $this->source, (isset($context["BaseInfo"]) || array_key_exists("BaseInfo", $context) ? $context["BaseInfo"] : (function () { throw new RuntimeError('Variable "BaseInfo" does not exist.', 413, $this->source); })()), "delivery_free_quantity", [], "any", false, false, true, 413))) {
// line 414
echo " <br/>
";
// line 415
if (twig_get_attribute($this->env, $this->source, (isset($context["is_delivery_free"]) || array_key_exists("is_delivery_free", $context) ? $context["is_delivery_free"] : (function () { throw new RuntimeError('Variable "is_delivery_free" does not exist.', 415, $this->source); })()), (isset($context["cartKey"]) || array_key_exists("cartKey", $context) ? $context["cartKey"] : (function () { throw new RuntimeError('Variable "cartKey" does not exist.', 415, $this->source); })()), [], "array", false, false, true, 415)) {
// line 416
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("現在日本国内は送料無料です。"), "html", null, true);
echo "
";
} else {
// line 418
echo " ";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("あと「<strong>%price%</strong>」または「<strong>%quantity%個</strong>」のお買い上げで<strong class=\"ec-color-red\">送料無料</strong>になります。", ["%price%" => $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["least"]) || array_key_exists("least", $context) ? $context["least"] : (function () { throw new RuntimeError('Variable "least" does not exist.', 418, $this->source); })()), (isset($context["cartKey"]) || array_key_exists("cartKey", $context) ? $context["cartKey"] : (function () { throw new RuntimeError('Variable "cartKey" does not exist.', 418, $this->source); })()), [], "array", false, false, true, 418), 418, $this->source)), "%quantity%" => twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["quantity"]) || array_key_exists("quantity", $context) ? $context["quantity"] : (function () { throw new RuntimeError('Variable "quantity" does not exist.', 418, $this->source); })()), (isset($context["cartKey"]) || array_key_exists("cartKey", $context) ? $context["cartKey"] : (function () { throw new RuntimeError('Variable "cartKey" does not exist.', 418, $this->source); })()), [], "array", false, false, true, 418), 418, $this->source))]);
echo "
";
}
// line 420
echo " ";
} elseif (twig_get_attribute($this->env, $this->source, (isset($context["BaseInfo"]) || array_key_exists("BaseInfo", $context) ? $context["BaseInfo"] : (function () { throw new RuntimeError('Variable "BaseInfo" does not exist.', 420, $this->source); })()), "delivery_free_amount", [], "any", false, false, true, 420)) {
// line 421
echo " <br/>
";
// line 422
if (twig_get_attribute($this->env, $this->source, (isset($context["is_delivery_free"]) || array_key_exists("is_delivery_free", $context) ? $context["is_delivery_free"] : (function () { throw new RuntimeError('Variable "is_delivery_free" does not exist.', 422, $this->source); })()), (isset($context["cartKey"]) || array_key_exists("cartKey", $context) ? $context["cartKey"] : (function () { throw new RuntimeError('Variable "cartKey" does not exist.', 422, $this->source); })()), [], "array", false, false, true, 422)) {
// line 423
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("現在日本国内は送料無料です。"), "html", null, true);
echo "
";
} else {
// line 425
echo " ";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("あと「<strong>%price%</strong>」のお買い上げで<strong class=\"ec-color-red\">送料無料</strong>になります。", ["%price%" => $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["least"]) || array_key_exists("least", $context) ? $context["least"] : (function () { throw new RuntimeError('Variable "least" does not exist.', 425, $this->source); })()), (isset($context["cartKey"]) || array_key_exists("cartKey", $context) ? $context["cartKey"] : (function () { throw new RuntimeError('Variable "cartKey" does not exist.', 425, $this->source); })()), [], "array", false, false, true, 425), 425, $this->source))]);
echo "
";
}
// line 427
echo " ";
} elseif (twig_get_attribute($this->env, $this->source, (isset($context["BaseInfo"]) || array_key_exists("BaseInfo", $context) ? $context["BaseInfo"] : (function () { throw new RuntimeError('Variable "BaseInfo" does not exist.', 427, $this->source); })()), "delivery_free_quantity", [], "any", false, false, true, 427)) {
// line 428
echo " <br/>
";
// line 429
if (twig_get_attribute($this->env, $this->source, (isset($context["is_delivery_free"]) || array_key_exists("is_delivery_free", $context) ? $context["is_delivery_free"] : (function () { throw new RuntimeError('Variable "is_delivery_free" does not exist.', 429, $this->source); })()), (isset($context["cartKey"]) || array_key_exists("cartKey", $context) ? $context["cartKey"] : (function () { throw new RuntimeError('Variable "cartKey" does not exist.', 429, $this->source); })()), [], "array", false, false, true, 429)) {
// line 430
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("現在日本国内は送料無料です。"), "html", null, true);
echo "
";
} else {
// line 432
echo " ";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("あと「<strong>%quantity%個</strong>」のお買い上げで<strong class=\"ec-color-red\">送料無料</strong>になります。", ["%quantity%" => twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["quantity"]) || array_key_exists("quantity", $context) ? $context["quantity"] : (function () { throw new RuntimeError('Variable "quantity" does not exist.', 432, $this->source); })()), (isset($context["cartKey"]) || array_key_exists("cartKey", $context) ? $context["cartKey"] : (function () { throw new RuntimeError('Variable "cartKey" does not exist.', 432, $this->source); })()), [], "array", false, false, true, 432), 432, $this->source))]);
echo "
";
}
// line 434
echo " ";
}
// line 435
echo " </div>
";
// line 438
echo " ";
$context["size_price_total"] = 0;
// line 439
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["Cart"], "CartItems", [], "any", false, false, true, 439));
foreach ($context['_seq'] as $context["_key"] => $context["CartItem"]) {
// line 440
echo " ";
$context["size_price_total"] = ((isset($context["size_price_total"]) || array_key_exists("size_price_total", $context) ? $context["size_price_total"] : (function () { throw new RuntimeError('Variable "size_price_total" does not exist.', 440, $this->source); })()) + twig_get_attribute($this->env, $this->source, $context["CartItem"], "size_price", [], "any", false, false, true, 440));
// line 441
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 442
echo " ";
$context["price_total"] = (twig_get_attribute($this->env, $this->source, $context["Cart"], "totalPrice", [], "any", false, false, true, 442) + (isset($context["size_price_total"]) || array_key_exists("size_price_total", $context) ? $context["size_price_total"] : (function () { throw new RuntimeError('Variable "size_price_total" does not exist.', 442, $this->source); })()));
// line 443
echo " <span id=\"price_total_tmp\" class=\"d-none\">";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["price_total"]) || array_key_exists("price_total", $context) ? $context["price_total"] : (function () { throw new RuntimeError('Variable "price_total" does not exist.', 443, $this->source); })()), 443, $this->source), "html", null, true);
echo "</span>
<div class=\"ec-cartRole__actions\">
<div>";
// line 446
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("オプション計:"), "html", null, true);
echo "<span id=\"option_total\">";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(0), "html", null, true);
echo "</span><small>(税込)</small></div>
<div class=\"ec-cartRole__total\">";
// line 447
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("合計:"), "html", null, true);
echo "<span id=\"cart_total\" class=\"ec-cartRole__totalAmount\">";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter($this->sandbox->ensureToStringAllowed((isset($context["price_total"]) || array_key_exists("price_total", $context) ? $context["price_total"] : (function () { throw new RuntimeError('Variable "price_total" does not exist.', 447, $this->source); })()), 447, $this->source)), "html", null, true);
echo "</span><small>(税込)</small>
</div>
";
// line 450
echo " <span class=\"action_btn_wrapper\"><button class=\"ec-blockBtn--action text-white\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("レジに進む"), "html", null, true);
echo "</button></span>
";
// line 451
if (twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, true, 451)) {
// line 452
echo " <a class=\"ec-blockBtn--cancel\" href=\"";
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>
";
}
// line 454
echo " </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 456
echo " </form>
";
} else {
// line 458
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.', 458, $this->source); })()));
foreach ($context['_seq'] as $context["CartIndex"] => $context["Cart"]) {
// line 459
echo " ";
$context["cartKey"] = twig_get_attribute($this->env, $this->source, $context["Cart"], "cart_key", [], "any", false, false, true, 459);
// line 460
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.', 460, $this->source); })()), "session", [], "any", false, false, true, 460), "flashbag", [], "any", false, false, true, 460), "get", [0 => (("eccube.front.cart." . (isset($context["cartKey"]) || array_key_exists("cartKey", $context) ? $context["cartKey"] : (function () { throw new RuntimeError('Variable "cartKey" does not exist.', 460, $this->source); })())) . ".request.error")], "method", false, false, true, 460));
foreach ($context['_seq'] as $context["_key"] => $context["error"]) {
// line 461
echo " <div class=\"ec-cartRole__error\">
<div class=\"ec-alert-warning\">
<div class=\"ec-alert-warning__icon\"><img src=\"";
// line 463
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 465
echo twig_nl2br(twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($this->sandbox->ensureToStringAllowed($context["error"], 465, $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 470
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 471
echo " <div class=\"ec-role\">
<div class=\"ec-off3Grid\">
<div class=\"ec-off3Grid__cell\">
<div class=\"ec-alert-warning\">
<div class=\"ec-alert-warning__icon\"><img src=\"";
// line 475
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 476
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("現在カート内に商品はございません。"), "html", null, true);
echo "</div>
</div>
</div>
</div>
</div>
";
}
// line 482
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 ( 1101 => 482, 1092 => 476, 1088 => 475, 1082 => 471, 1076 => 470, 1065 => 465, 1060 => 463, 1056 => 461, 1051 => 460, 1048 => 459, 1043 => 458, 1039 => 456, 1024 => 454, 1016 => 452, 1014 => 451, 1009 => 450, 1002 => 447, 996 => 446, 989 => 443, 986 => 442, 980 => 441, 977 => 440, 972 => 439, 969 => 438, 965 => 435, 962 => 434, 956 => 432, 950 => 430, 948 => 429, 945 => 428, 942 => 427, 936 => 425, 930 => 423, 928 => 422, 925 => 421, 922 => 420, 916 => 418, 910 => 416, 908 => 415, 905 => 414, 903 => 413, 898 => 410, 884 => 409, 882 => 408, 873 => 407, 867 => 406, 864 => 405, 861 => 404, 859 => 403, 856 => 402, 853 => 401, 851 => 400, 848 => 399, 843 => 398, 841 => 397, 834 => 393, 829 => 390, 823 => 376, 819 => 375, 810 => 371, 808 => 370, 804 => 369, 801 => 368, 798 => 367, 791 => 366, 788 => 365, 780 => 363, 777 => 362, 774 => 361, 766 => 359, 763 => 358, 761 => 357, 755 => 356, 745 => 351, 741 => 350, 733 => 345, 726 => 344, 721 => 341, 718 => 340, 712 => 337, 708 => 336, 704 => 335, 700 => 334, 697 => 333, 695 => 332, 692 => 331, 689 => 330, 687 => 329, 679 => 327, 661 => 326, 659 => 325, 654 => 323, 650 => 322, 646 => 321, 642 => 320, 636 => 316, 625 => 311, 620 => 309, 616 => 307, 612 => 306, 604 => 304, 601 => 303, 584 => 302, 579 => 300, 574 => 299, 571 => 297, 563 => 292, 558 => 289, 556 => 288, 550 => 285, 546 => 283, 543 => 282, 532 => 277, 527 => 275, 523 => 273, 518 => 272, 501 => 268, 495 => 266, 489 => 264, 487 => 263, 482 => 261, 478 => 259, 475 => 258, 457 => 257, 455 => 256, 447 => 251, 444 => 250, 441 => 249, 434 => 245, 431 => 244, 428 => 243, 421 => 239, 418 => 238, 415 => 237, 412 => 236, 405 => 232, 402 => 231, 399 => 230, 396 => 229, 394 => 228, 388 => 225, 385 => 224, 382 => 223, 379 => 222, 377 => 221, 367 => 214, 363 => 212, 353 => 211, 206 => 72, 200 => 71, 186 => 70, 178 => 68, 175 => 67, 167 => 65, 164 => 64, 156 => 62, 153 => 61, 148 => 59, 144 => 58, 139 => 57, 136 => 56, 118 => 55, 114 => 54, 74 => 16, 64 => 15, 53 => 11, 51 => 13, 38 => 11,);
}
public function getSourceContext()
{
return new Source("{#
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.
#}
{% extends 'default_frame.twig' %}
{% set body_class = 'cart_page' %}
{% block javascript %}
<script>
\$(function() {
var cnt = \$('.ec-cartRow').length;
for (let i = 0; i < cnt; i++){
// Get the data-prototype explained earlier
var prototype = \$('.cartitems').data('prototype');
// get the new index
var index = \$('.cartitems').data('index');
// Replace '__name__' in the prototype's HTML to
// instead be a number based on how many items we have
var newForm = '<div class=\"mt-3 pb-0 d-flex flex-wrap justify-content-between\"><span>オプションを選択してください。</span><span>オプション小計:<span><span class=\"item_option_price_' + index + '\">¥0</span></span><small>(税込)</small></span></div>';
newForm += '<div class=\"mt-2 mb-3 p-3 bg-white cart_option\" id=\"cart_option_' + index + '\">';
newForm += prototype.replace(/__name__/g, index);
newForm += '<div class=\"d-flex flex-column flex-md-row\"><span class=\"w_120\"></span><span>インサイド石は、刻印がある場合は刻印の直後にセッティングさせていただきます。<br>';
newForm += '石の位置の変更をご希望の場合は購入手続き画面のお問い合わせ欄にご記入ください。</span></p>';
newForm += '</div>';
// increase the index with one for the next item
\$('.cartitems').data('index', index + 1);
// Display the form in the page before the \"new\" link
//\$(this).before(newForm);
var add = \".add_option_\" + i;
// ID119の商品はオプションを表示しない
// 結婚指輪でも婚約指輪でもない場合はオプションを表示しない
if (\$(add).hasClass('itemid_119') || \$(add).hasClass('itemcat_0')) {
newForm = '<hr><div class=\"d-none\">' + newForm + '</div>';
}
\$(add).before(newForm);
}
// 刻印文字数の注意書き追加
\$('input[id\$=\"engraving_text\"]').each(function () {
\$(this).parent().addClass('flex-wrap');
\$(this).after('<p class=\"w-100 engraving_text_notice\">刻印できる文字数は最大19文字です。</p>')
});
// 読み込み時 すでに値があったら表示する
{% for CartIndex,Cart in Carts %}
{% for CartItem in Cart.CartItems %}
{% if CartItem.engraving == \"あり\" %}
\$('input[name=\"form[data][' + {{ loop.index0 }} + '][engraving]\"]').val([\"あり\"]);
\$('#form_data_' + {{ loop.index0 }} + ' > div').css('display','flex');
\$('#form_data_' + {{ loop.index0 }} + ' fieldset:nth-child(2)').css('display','flex');
{% endif %}
{% if CartItem.engraving_font is not null %}
\$('input[name=\"form[data][' + {{ loop.index0 }} + '][engraving_font]\"]').val([\"{{ CartItem.engraving_font }}\"]);
{% endif %}
{% if CartItem.engraving_text is not null %}
\$('input[name=\"form[data][' + {{ loop.index0 }} + '][engraving_text]\"]').val(\"{{ CartItem.engraving_text }}\");
{% endif %}
{% if CartItem.stone != \"なし\" and CartItem.stone is not null %}
\$('input[name=\"form[data][' + {{ loop.index0 }} + '][stone]\"]').val([\"{{ CartItem.stone }}\"]);
{% endif %}
{% endfor %}
{% endfor %}
var cnt = \$('.ec-cartRow').length;
for (let i = 0; i < cnt; i++) {
var cart_option = document.getElementById(\"cart_option_\" + i);
if (cart_option === null) {
} else {
if (\$('input[name=\"form[data][' + i + '][engraving]\"]:checked').val() == \"あり\") { // 刻印あり
\$('#form_data_' + i + ' > div').css('display','flex');
\$('#form_data_' + i + ' fieldset:nth-child(2)').css('display','flex');
if (\$('input[name=\"form[data][' + i + '][engraving_font]\"]:checked').val() == null) {
\$('.action_btn_wrapper').addClass('not_available');
go = false;
} else if (!\$('input[name=\"form[data][' + i + '][engraving_text]\"]').val()) {
\$('.action_btn_wrapper').addClass('not_available');
go = false;
}
} else if (\$('input[name=\"form[data][' + i + '][engraving]\"]:checked').val() == \"なし\") {
\$('input[name=\"form[data][' + i + '][engraving_font]\"]:checked').prop('checked', false);
\$('#form_data_' + i + ' > div').css('display','none');
\$('#form_data_' + i + ' fieldset:nth-child(2)').css('display','none');
}
}
}
checkEngraving();
calcTotal();
// cart_key と cart_id をセット
var cnt = \$('.ec-cartRow').length;
for (let i = 0; i < cnt; i++) {
\$('input[name=\"form[data][' + i + '][cart_key]\"]').val(\$('#ck_0').text()); // cartkey は同じカートなら同じ
\$('input[name=\"form[data][' + i + '][cart_item_id]\"]').val(\$('#ciid_' + i).text());
}
\$('.form-check-input').on('change', function(event) {
checkEngraving();
calcTotal();
});
\$('input[id\$=\"engraving_text\"]').on('keyup', function(event) {
let count = \$(this).val().length;
if (count > 19){
if (!\$(this).parent().prev().hasClass('text_count_message')) {
\$(this).parent().before('<p class=\"mb-2 text_count_message text-danger\">※刻印は19文字までです</p>');
\$('.action_btn_wrapper').addClass('not_available');
}
} else {
if (\$(this).parent().prev().hasClass('text_count_message')) {
\$(this).parent().prev('.text_count_message').remove();
}
}
});
\$('.form-control').on('change', function(event) {
checkEngraving();
});
function checkEngraving() {
var cnt = \$('.ec-cartRow').length;
var go = true;
for (let i = 0; i < cnt; i++) {
var cart_option = document.getElementById(\"cart_option_\" + i);
if (cart_option === null) {
} else {
if (\$('input[name=\"form[data][' + i + '][engraving]\"]:checked').val() == \"あり\") { // 刻印あり
\$('#form_data_' + i + ' > div').css('display','flex');
\$('#form_data_' + i + ' fieldset:nth-child(2)').css('display','flex');
if (\$('input[name=\"form[data][' + i + '][engraving_font]\"]:checked').val() == null) {
\$('.action_btn_wrapper').addClass('not_available');
go = false;
} else if (!\$('input[name=\"form[data][' + i + '][engraving_text]\"]').val()) {
\$('.action_btn_wrapper').addClass('not_available');
go = false;
}
} else if (\$('input[name=\"form[data][' + i + '][engraving]\"]:checked').val() == \"なし\") {
\$('input[name=\"form[data][' + i + '][engraving_font]\"]:checked').prop('checked', false);
\$('#form_data_' + i + ' > div').css('display','none');
\$('#form_data_' + i + ' fieldset:nth-child(2)').css('display','none');
}
}
}
if (go) {
\$('.action_btn_wrapper').removeClass('not_available');
}
}
function calcTotal() {
var cnt = \$('.ec-cartRow').length;
var option_total = 0;
for (let i = 0; i < cnt; i++) {
var item_option_price = 0;
var cart_option = document.getElementById(\"cart_option_\" + i);
if (cart_option === null) {
} else {
if (\$('input[name=\"form[data][' + i + '][engraving]\"]:checked').val() == \"あり\") {
//item_option_price += 5500;
}
switch (\$('input[name=\"form[data][' + i + '][engraving_font]\"]:checked').val()) {
case \"有料書体1\":
case \"有料書体2\":
case \"有料書体3\":
case \"有料書体4\":
case \"有料書体5\":
case \"有料書体6\":
case \"有料書体7\":
case \"有料書体8\":
case \"有料書体9\":
case \"有料書体10\":
item_option_price += 5500;
break;
default:
}
switch (\$('input[name=\"form[data][' + i + '][stone]\"]:checked').val()) {
case \"なし\":
break;
default:
// 一律料金?
item_option_price += 5500;
}
}
var item_option_total_price = String(item_option_price).replace(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/g, '\$1,');
\$('.item_option_price_' + i).text(\"¥\" + item_option_total_price);
\$('input[name=\"form[data][' + i + '][option_total_price]\"]').val(item_option_price);
option_total += item_option_price;
}
var option_total_price = String(option_total).replace(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/g, '\$1,');
\$('#option_total').text(\"¥\" + option_total_price);
// 総合計更新
var total_price = \$('#price_total_tmp').text();
total_price = total_price * 1; //number
total_price += option_total;
var cart_total_price = String(total_price).replace(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/g, '\$1,');
\$('#cart_total').text(\"¥\" + cart_total_price);
}
\$('.ec-blockBtn--action').on('click', function(event) {
calcTotal();
});
});
</script>
{% endblock %}
{% block main %}
<div class=\"ec-role\">
<div class=\"ec-pageHeader\">
<h1>{{ 'ショッピングカート'|trans }}</h1>
</div>
</div>
<div class=\"ec-cartRole\">
<div class=\"ec-cartRole__progress\">
<ul class=\"ec-progress\">
{% set step = 1 %}
<li class=\"ec-progress__item is-complete\">
<div class=\"ec-progress__number\">{{ step }}{% set step = step + 1 %}
</div>
<div class=\"ec-progress__label\">{{ 'カートの商品'|trans }}
</div>
</li>
{% if is_granted('ROLE_USER') == false %}
<li class=\"ec-progress__item\">
<div class=\"ec-progress__number\">{{ step }}{% set step = step + 1 %}
</div>
<div class=\"ec-progress__label\">{{ 'お客様情報'|trans }}
</div>
</li>
{% endif %}
<li class=\"ec-progress__item\">
<div class=\"ec-progress__number\">{{ step }}{% set step = step + 1 %}
</div>
<div class=\"ec-progress__label\">{{ 'ご注文手続き'|trans }}
</div>
</li>
<li class=\"ec-progress__item\">
<div class=\"ec-progress__number\">{{ step }}{% set step = step + 1 %}
</div>
<div class=\"ec-progress__label\">{{ 'ご注文内容確認'|trans }}
</div>
</li>
<li class=\"ec-progress__item\">
<div class=\"ec-progress__number\">{{ step }}{% set step = step + 1 %}
</div>
<div class=\"ec-progress__label\">{{ '完了'|trans }}
</div>
</li>
</ul>
</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/icon/exclamation-white.svg') }}\"></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/icon/exclamation-white.svg') }}\"></div>
<div class=\"ec-alert-warning__text\">
{{ error|trans|nl2br }}
</div>
</div>
</div>
{% endfor %}
{% if totalQuantity > 0 %}
<!--<div class=\"ec-cartRole__totalText\">
<p>
{{ '商品の合計金額は「<strong>%price%</strong>」です。'|trans({ '%price%': totalPrice|price })|raw }}
</p>
</div>-->
{% 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\" class=\"ec-cartRole\" method=\"post\" action=\"{{ url('cart') }}\">#}
<form name=\"form\" id=\"form_cart\" class=\"ec-cartRole\" method=\"post\" action=\"{{ url('cart_add_option') }}\">
<div class=\"cartitems\" data-prototype=\"{{ form_widget(form.data.vars.prototype)|e('html_attr') }}\" data-index=0></div>
{% for CartIndex,Cart in Carts %}
{% set cartKey = Cart.cart_key %}
<span id=\"ck_{{ loop.index0 }}\" class=\"d-none\">{{ cartKey }}</span>
{% 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 %}
<div class=\"ec-cartRole__cart\">
<!--<div class=\"ec-cartTable\">
<ol class=\"ec-cartHeader\">
<li class=\"ec-cartHeader__label\">{{ '削除'|trans }}</li>
<li class=\"ec-cartHeader__label\">{{ '商品内容'|trans }}</li>
<li class=\"ec-cartHeader__label\">{{ '数量'|trans }}</li>
<li class=\"ec-cartHeader__label\">{{ '小計'|trans }}</li>
</ol>-->
{% set item_cnt = 0 %}
{% for CartItem in Cart.CartItems %}
<span id=\"ciid_{{ loop.index0 }}\" class=\"d-none\">{{ CartItem.id }}</span>
{% set ProductClass = CartItem.ProductClass %}
{% set Product = ProductClass.Product %}
<div class=\"ec-cartTable\">
{% if loop.index == 1 %}
<ol class=\"ec-cartHeader\">
<li class=\"ec-cartHeader__label\">{{ '削除'|trans }}</li>
<li class=\"ec-cartHeader__label\">{{ '商品内容'|trans }}</li>
<li class=\"ec-cartHeader__label\">{{ '数量'|trans }}</li>
<li class=\"ec-cartHeader__label\">{{ '小計'|trans }}</li>
</ol>
{% endif %}
<ul class=\"ec-cartRow cartitem cartitem_{{ item_cnt }}\">
<li class=\"ec-cartRow__delColumn\">
{#<a href=\"{{ url('cart_handle_item', {'operation': 'remove', 'productClassId': ProductClass.id }) }}\" {{ csrf_token_for_anchor() }} class=\"ec-icon\" data-method=\"put\" data-message=\"カートから商品を削除してもよろしいですか?\">#}
<a href=\"{{ url('cart_handle_item', {'operation': 'remove', 'productClassId': CartItem.id }) }}\" {{ csrf_token_for_anchor() }} class=\"ec-icon\" data-method=\"put\" data-message=\"カートから商品を削除してもよろしいですか?\">
<img src=\"{{ asset('assets/icon/cross.svg') }}\" alt=\"delete\">
</a>
</li>
<li class=\"ec-cartRow__contentColumn\">
<div class=\"ec-cartRow__img\">
<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-cartRow__summary\">
<div class=\"ec-cartRow__name\">
<a target=\"_blank\" href=\"{{ url('product_detail', {id : Product.id} ) }}\">{{ Product.name }}</a>
{% if ProductClass.ClassCategory1 and ProductClass.ClassCategory1.id %}
{% if Product.id != 119 %}
<br>{{ ProductClass.ClassCategory1.ClassName.name }}:{{ ProductClass.ClassCategory1 }}
{% endif %}
{% endif %}
{% if ProductClass.ClassCategory2 and ProductClass.ClassCategory2.id %}
<br>{{ ProductClass.ClassCategory2.ClassName.name }}:{{ ProductClass.ClassCategory2 }}
{% endif %}
{% if Product.id != 119 %}
{% if CartItem.size %} サイズ:{{ CartItem.size }}号{% endif %}
{% endif %}
</div>
<!--<div class=\"ec-cartRow__unitPrice\">{{ CartItem.price|price }}</div>-->
{% set sum = CartItem.total_price + CartItem.size_price %}
<div class=\"ec-cartRow__sutbtotalSP\">{{ '小計:'|trans }}{{ sum|price }}</div>
</div>
</li>
<li class=\"ec-cartRow__amountColumn\">
<div class=\"ec-cartRow__amount\">{{ CartItem.quantity|number_format }}</div>
<div class=\"ec-cartRow__amountSP\">{{ '数量:'|trans }}{{ CartItem.quantity|number_format }}</div>
<div class=\"ec-cartRow__amountUpDown\">
{#{% if CartItem.quantity > 1 %}
<a 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/icon/minus-dark.svg') }}\" alt=\"reduce\"></span>
</a>
{% else %}
<div class=\"ec-cartRow__amountDownButtonDisabled\">
<span class=\"ec-cartRow__amountDownButton__icon\"><img src=\"{{ asset('assets/icon/minus.svg') }}\" alt=\"reduce\"></span>
</div>
{% endif %}
<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/icon/plus-dark.svg') }}\" alt=\"increase\"></span>
</a>#}
</div>
</li>
<li class=\"ec-cartRow__subtotalColumn\">
<div class=\"ec-cartRow__sutbtotal\">{{ sum|price }}<small>(税込)</small></div>
</li>
</ul>
</div>
{% set category = 0 %}
{% for ProductCategory in Product.ProductCategories %}
{% if ProductCategory.Category.id == 1 %}
{# 結婚指輪 #}
{% set category = 1 %}
{% elseif ProductCategory.Category.id == 2 %}
{# 婚約指輪 #}
{% set category = 2 %}
{% endif %}
{% endfor %}
<a href=\"#\" class=\"add_option add_option_{{ item_cnt }} itemid_{{ Product.id }} itemcat_{{ category }} d-none\"></a>
{% set item_cnt = item_cnt + 1 %}
{% endfor %}
</div>
<div class=\"ec-cartRole__progress\">
{% if BaseInfo.delivery_free_amount and BaseInfo.delivery_free_quantity %}
<br/>
{% if is_delivery_free[cartKey] %}
{{ '現在日本国内は送料無料です。'|trans }}
{% else %}
{{ 'あと「<strong>%price%</strong>」または「<strong>%quantity%個</strong>」のお買い上げで<strong class=\"ec-color-red\">送料無料</strong>になります。'|trans({ '%price%': least[cartKey]|price, '%quantity%': quantity[cartKey]|number_format })|raw }}
{% endif %}
{% elseif BaseInfo.delivery_free_amount %}
<br/>
{% if is_delivery_free[cartKey] %}
{{ '現在日本国内は送料無料です。'|trans }}
{% else %}
{{ 'あと「<strong>%price%</strong>」のお買い上げで<strong class=\"ec-color-red\">送料無料</strong>になります。'|trans({ '%price%': least[cartKey]|price })|raw }}
{% endif %}
{% elseif BaseInfo.delivery_free_quantity %}
<br/>
{% if is_delivery_free[cartKey] %}
{{ '現在日本国内は送料無料です。'|trans }}
{% else %}
{{ 'あと「<strong>%quantity%個</strong>」のお買い上げで<strong class=\"ec-color-red\">送料無料</strong>になります。'|trans({ '%quantity%': quantity[cartKey]|number_format })|raw }}
{% endif %}
{% endif %}
</div>
{# カート合計金額にサイズ割増料金を加算 #}
{% set size_price_total = 0 %}
{% for CartItem in Cart.CartItems %}
{% set size_price_total = size_price_total + CartItem.size_price %}
{% endfor %}
{% set price_total = Cart.totalPrice + size_price_total %}
<span id=\"price_total_tmp\" class=\"d-none\">{{ price_total }}</span>
<div class=\"ec-cartRole__actions\">
<div>{{ 'オプション計:'|trans }}<span id=\"option_total\">{{ 0|price }}</span><small>(税込)</small></div>
<div class=\"ec-cartRole__total\">{{ '合計:'|trans }}<span id=\"cart_total\" class=\"ec-cartRole__totalAmount\">{{ price_total|price }}</span><small>(税込)</small>
</div>
{#<span class=\"action_btn_wrapper\"><a class=\"ec-blockBtn--action text-white\" href=\"{{ path('cart_buystep', {'cart_key':cartKey}) }}\">{{ 'レジに進む'|trans }}</a></span>#}
<span class=\"action_btn_wrapper\"><button class=\"ec-blockBtn--action text-white\">{{ 'レジに進む'|trans }}</button></span>
{% if loop.last %}
<a class=\"ec-blockBtn--cancel\" href=\"{{ path('homepage') }}\">{{ 'お買い物を続ける'|trans }}</a>
{% endif %}
</div>
{% endfor %}
</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=\"ec-alert-warning\">
<div class=\"ec-alert-warning__icon\"><img src=\"{{ asset('assets/icon/exclamation-white.svg') }}\"></div>
<div class=\"ec-alert-warning__text\">{{ '現在カート内に商品はございません。'|trans }}</div>
</div>
</div>
</div>
</div>
{% endif %}
</div>
{% endblock %}", "Cart/index.twig", "/home/apteq5/apteq5x.com/public_html/tanzoec/app/template/tanzo/Cart/index.twig");
}
public function checkSecurity()
{
static $tags = array("set" => 13, "for" => 54, "if" => 56);
static $filters = array("escape" => 57, "trans" => 214, "nl2br" => 264, "raw" => 285, "price" => 285, "length" => 288, "e" => 300, "no_image_product" => 351, "number_format" => 375);
static $functions = array("is_granted" => 228, "asset" => 261, "url" => 299, "form_widget" => 300, "csrf_token_for_anchor" => 344, "path" => 452);
try {
$this->sandbox->checkSecurity(
['set', 'for', 'if'],
['escape', 'trans', 'nl2br', 'raw', 'price', 'length', 'e', 'no_image_product', 'number_format'],
['is_granted', 'asset', 'url', 'form_widget', '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;
}
}
}