<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
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;
use Twig\TemplateWrapper;
/* frontend/cart/cart.html.twig */
class __TwigTemplate_372011d8a7ad6d70e8b9629c92b47650f41f8cdaf243a7adc46183f6fb844dbe extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'facebook' => [$this, 'block_facebook'],
'stylesheets' => [$this, 'block_stylesheets'],
'javascripts' => [$this, 'block_javascripts'],
'content' => [$this, 'block_content'],
];
}
protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
{
// line 1
return "base.html.twig";
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "frontend/cart/cart.html.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "frontend/cart/cart.html.twig"));
$this->parent = $this->loadTemplate("base.html.twig", "frontend/cart/cart.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
// line 5
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_facebook(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "facebook"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "facebook"));
// line 6
yield " ";
yield from $this->yieldParentBlock("facebook", $context, $blocks);
yield "
<META NAME=\"ROBOTS\" CONTENT=\"NOINDEX, NOFOLLOW\">
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
yield from [];
}
// line 10
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_stylesheets(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheets"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheets"));
// line 11
yield " ";
yield from $this->yieldParentBlock("stylesheets", $context, $blocks);
yield "
<style>
.table td, .table th {
vertical-align: middle!important;
padding-left:5px!important;
}
@media screen and (min-width: 769px) and (max-width:1024px) {
.column.is-9 {
width:70% !important;
}
}
.custom-radio-wrapper{
display:flex;
align-items:flex-start; /* keeps radio button and text aligned */
border-radius:4px;
cursor:pointer;
}
.custom-radio-wrapper .custom-radio-container{
display:flex;
align-items:flex-start;
}
/* title line */
.payment-title{
font-size:1rem; /* ~16 px */
font-weight:500;
line-height:1.3;
display:block;
}
/* extra info line */
.payment-desc{
font-size:.8125rem; /* ~13 px */
color:#666;
line-height:1.25;
display:block; /* forces a new line */
margin-top:.125rem;
}
</style>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
yield from [];
}
// line 58
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_javascripts(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
// line 59
yield " ";
yield from $this->yieldParentBlock("javascripts", $context, $blocks);
yield "
<script>
\$(document ).ready(function() {
function colorize(element, className) {
console.log('colorize');
\$(\".\"+className+\" tbody tr\").each(function(){
console.log(\$(this));
\$(this).css('border', '1px solid #dbdbdb');
});
\$(\".\"+className+\" tbody tr\").css('border', '1px solid #dbdbdb');
element.closest('tr').css('border', '2px solid #44bc42');
}
/* Change quantity of the ordered product */
\$(document).on('input', '.quantity-input', function (e) {
var product = \$(this).attr('data-product');
var url = \$('#update_quantity_cart').val();
var record = \$(this).attr('data-record');
var quantity = \$(this).val();
\$('#quantity_loader_'+product).show();
\$.ajax({
url: url,
type:\"POST\",
data:{'record_id':record, 'quantity':quantity, 'product_id':product},
success:function (data) {
console.log(data);
if (parseInt(data.error) === 1) {
\$('.cart-error-notification').show();
\$('.cart-error-notification').html(data.message);
\$(\"html, body\").animate({ scrollTop: \$('.cart-error-notification').offset().top }, 200);
}
\$('.loader_group').hide();
var cartUrl = \$('#cart_url').val();
\$('#cart-table').load(cartUrl+' #cart-table', {}, function(response) {
calculateSum();
});
}
});
});
/* Trigger click of first element id delivery list */
\$(\"input:radio[name=deliveryMethod]:first\").trigger(\"click\");
colorize(\$(\"input:radio[name=deliveryMethod]:first\"), 'delivery-methods-table');
var \$deliveryMethodContent = \$('#deliveryMethodsContent');
var \$paymentMethodContainer = \$('#paymentMethodsContent');
var loadPaymentMethods = function() {
var id = \$('.deliveryMethod').val();
\$paymentMethodContainer.html(' ');
var url = \$('#load_payment_methods').val();
\$paymentMethodContainer.load(url, {'id':id}, function() {
calculateSum();
});
}
loadPaymentMethods();
/* Removes element from cart */
\$(document).on('click', '.btn-cart-remove', 'click', function (e) {
var url = \$('#remove_cart_url').val();
var record = \$(this).attr('data-record');
var product = \$(this).attr('data-product');
var productId = \$(this).attr('data-id');
\$('#quantity_loader_'+product).show();
\$.ajax({
url: url,
type:\"POST\",
data:{'record_id':record, 'product_id':product},
success:function (data) {
console.log(data);
\$('.loader_group').hide();
var cartUrl = \$('#cart_url').val();
\$('.cart-products').load(cartUrl+' .cart-products', {}, function(response) {
console.log(response);
});
calculateSum();
}
});
});
/** Change country -> release load form od delviery */
\$(document).on('change', '#country', function (e) {
\$deliveryMethodContent.html(' ');
\$paymentMethodContainer.html(' ');
\$('#country_id').val(\$(this).val());
var url = \$('#load_delivery_methods').val();
\$deliveryMethodContent.load(url, {'id':\$(this).val()}, function() {
\$(\"input:radio[name=deliveryMethod]:first\").trigger(\"click\");
});
});
/** Load payment methods */
\$(document).on('change', '.deliveryMethod', function (e) {
colorize(\$(this), 'delivery-methods-table');
loadPaymentMethods();
});
/**
* Dynamically calculate total sum of product and dlivery + payment method
*/
var calculateSum = function () {
var deliveryId = \$('input[name=deliveryMethod]:checked').val();
var paymentId = \$('input[name=paymentMethod]:checked').val();
var url = \$('#ajax_calculate_sum').val();
\$.ajax({
url: url,
type:\"POST\",
data:{'deliveryId':deliveryId, 'paymentId':paymentId},
success:function (data) {
console.log(data);
\$('.totalSum').html(data.sum);
if (\$('.totalSumWithRebate').length) {
\$('.totalSumWithRebate').html(data.sumWithRebate);
}
if (\$('.totalSumWithoutRebate').length) {
\$('.totalSumWithoutRebate').html(data.sum);
}
if (\$('.savingsInfo').length) {
\$('.savingsInfo').html(data.savings);
}
}
});
}
/** Handle payment method change */
\$(document).on('click', '.paymentMethod', function (e) {
colorize(\$(this), 'payment-methods-table');
});
\$(document).on('click', '.deliveryMethod', function (e) {
colorize(\$(this), 'delivery-methods-table');
});
\$(document).on('change', '.paymentMethod', function (e) {
colorize(\$(this), 'payment-methods-table');
calculateSum();
});
\$(document).on(\"click\", \"#go-to-request-form\", \"click\", function() {
var urlRedirect = \$('#send_request_url').val();
window.location.href = urlRedirect;
});
\$(document).on('click', '.go-to-checkout', 'click', function (e) {
e.preventDefault();
var deliveryId = \$('input[name=deliveryMethod]:checked').val();
var paymentId = \$('input[name=paymentMethod]:checked').val();
if (deliveryId && paymentId) {
var url = \$('#ajax_save_cart').val();
\$.ajax({
url: url,
type:\"POST\",
data:{'deliveryId':deliveryId, 'paymentId':paymentId},
success:function (data) {
window.location.href = \$('#checkout_redirect').val();
}
});
} else {
\$(\"#modal-choose-delivery\").addClass(\"is-active\");
}
});
});
\$('.modal-close').click(function() {
\$(\"#modal-choose-delivery\").removeClass(\"is-active\");
});
\$('.close-modal-custom').click(function() {
\$(\"#modal-choose-delivery\").removeClass(\"is-active\");
});
</script>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
yield from [];
}
// line 252
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_content(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
// line 253
yield "
";
// line 254
$context["countCriteoProducts"] = 0;
// line 255
yield " ";
$context["criteoIds"] = [];
// line 256
yield "
";
// line 257
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["cartProducts"]) || array_key_exists("cartProducts", $context) ? $context["cartProducts"] : (function () { throw new RuntimeError('Variable "cartProducts" does not exist.', 257, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["product"]) {
// line 258
yield "
";
// line 259
$context["criteoIds"] = Twig\Extension\CoreExtension::merge((isset($context["criteoIds"]) || array_key_exists("criteoIds", $context) ? $context["criteoIds"] : (function () { throw new RuntimeError('Variable "criteoIds" does not exist.', 259, $this->source); })()), [CoreExtension::getAttribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 259)]);
// line 260
yield " ";
$context["countCriteoProducts"] = ((isset($context["countCriteoProducts"]) || array_key_exists("countCriteoProducts", $context) ? $context["countCriteoProducts"] : (function () { throw new RuntimeError('Variable "countCriteoProducts" does not exist.', 260, $this->source); })()) + 1);
// line 261
yield "
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['product'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 263
yield "
<input type=\"hidden\" id=\"load_delivery_methods\" value=\"";
// line 264
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("load_delivery_methods");
yield "\"/>
<input type=\"hidden\" id=\"load_payment_methods\" value=\"";
// line 265
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("load_payment_methods");
yield "\"/>
<input type=\"hidden\" id=\"ajax_calculate_sum\" value=\"";
// line 266
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ajax_calculate_sum");
yield "\"/>
<input type=\"hidden\" id=\"ajax_save_cart\" value=\"";
// line 267
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ajax_save_cart");
yield "\"/>
<input type=\"hidden\" id=\"send_request_url\" value=\"";
// line 268
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("send_request");
yield "\"/>
";
// line 269
if (CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "user", [], "any", false, true, false, 269), "id", [], "any", true, true, false, 269)) {
// line 270
yield " ";
if (CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 270, $this->source); })()), "user", [], "any", false, false, false, 270), "hasRole", ["ROLE_CUSTOMER_REGISTERED"], "method", false, false, false, 270)) {
// line 271
yield " <input type=\"hidden\" id=\"checkout_redirect\" value=\"";
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("register");
yield "\"/>
";
} else {
// line 273
yield " <input type=\"hidden\" id=\"checkout_redirect\" value=\"";
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("summary");
yield "\"/>
";
}
// line 275
yield " ";
} else {
// line 276
yield " <input type=\"hidden\" id=\"checkout_redirect\" value=\"";
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("register_login");
yield "\"/>
";
}
// line 278
yield " <input type=\"hidden\" id=\"cart_url\" value=\"";
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("cart");
yield "\"/>
<input type=\"hidden\" id=\"remove_cart_url\" value=\"";
// line 279
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("remove_from_cart");
yield "\"/>
<input type=\"hidden\" id=\"update_quantity_cart\" value=\"";
// line 280
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("update_quantity_cart");
yield "\"/>
";
// line 283
if ((Twig\Extension\CoreExtension::length($this->env->getCharset(), (isset($context["cartProducts"]) || array_key_exists("cartProducts", $context) ? $context["cartProducts"] : (function () { throw new RuntimeError('Variable "cartProducts" does not exist.', 283, $this->source); })())) > 0)) {
// line 284
yield "
<div class=\"row\" style=\"margin-top:20px;\">
<div class=\"col-sm-12\">
<section id=\"content\" role=\"main\">
<div class=\"container\">
<div class=\"row\">
<div class=\"\">
";
// line 295
if ((isset($context["showNotification"]) || array_key_exists("showNotification", $context) ? $context["showNotification"] : (function () { throw new RuntimeError('Variable "showNotification" does not exist.', 295, $this->source); })())) {
// line 296
yield " <div class=\"notification is-danger cart-error-notification\" style=\"text-align: center!important; margin:40px; display: block!important;\">
";
// line 297
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("products_deleted_info", [], "store"), "html", null, true);
yield "
</div>
";
}
// line 300
yield "
<div class=\"notification is-danger cart-error-notification\" style=\"text-align: center; display: none\">
</div>
";
// line 305
yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 305, $this->source); })()), 'errors');
yield "
";
// line 306
yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 306, $this->source); })()), 'form_start', ["attr" => ["id" => "cart-form", "method" => "post", "role" => "form", "novalidate" => "novalidate"]]);
yield "
<!-- START OF INFOGRAPHIC SECTION -->
<section class=\"section is-hidden-touch\">
<div class=\"container\">
<div class=\"columns is-center is-centered\">
<div class=\"column column-cart is-one-third\">
<div style=\"display: inline-block;\">
<div class=\"step_nr_new active\">
<i class=\"fa fa-check\"></i>
</div>
</div>
<div class=\"column is-narrow\" style=\"display: inline-block\">
<div class=\"step_txt active\">
";
// line 323
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("cart", [], "store"), "html", null, true);
yield "
</div>
<div class=\"\" style=\"width: 200px;\">
<hr class=\"cart-hr-active\">
</div>
</div>
</div>
<div class=\"column column-cart is-one-third column-back\">
<div style=\"display: inline-block;\">
<div class=\"step_nr_new\">
</div>
</div>
<div class=\"column is-narrow\" style=\"display: inline-block\">
<div class=\"step_txt\">
";
// line 338
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("shipping_data", [], "store"), "html", null, true);
yield "
</div>
<div class=\"\" style=\"width: 200px;\">
<hr class=\"cart-hr\">
</div>
</div>
</div>
<div class=\"column column-cart is-one-third column-back\">
<div style=\"display: inline-block;\">
<div class=\"step_nr_new\">
</div>
</div>
<div class=\"column is-narrow\" style=\"display: inline-block\">
<div class=\"step_txt\">
";
// line 353
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("summary", [], "store"), "html", null, true);
yield "
</div>
<div class=\"\" style=\"width: 200px;\">
<hr class=\"cart-hr\">
</div>
</div>
</div>
</div>
</div>
</section>
";
// line 365
yield from $this->loadTemplate("frontend/components/notification.html.twig", "frontend/cart/cart.html.twig", 365)->unwrap()->yield($context);
// line 366
yield "
";
// line 367
$context["total"] = 0;
// line 368
yield " ";
$context["quantityTotal"] = 0;
// line 369
yield " ";
$context["mainCategory"] = 0;
// line 370
yield "
";
// line 371
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 371, $this->source); })()), "products", [], "any", false, false, false, 371));
foreach ($context['_seq'] as $context["_key"] => $context["product"]) {
// line 372
yield "
";
// line 373
$context["productEntity"] = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["product"], "product", [], "any", false, false, false, 373), "vars", [], "any", false, false, false, 373), "data", [], "any", false, false, false, 373);
// line 374
yield " ";
$context["subProduct"] = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["product"], "subProduct", [], "any", false, false, false, 374), "vars", [], "any", false, false, false, 374), "data", [], "any", false, false, false, 374);
// line 375
yield " ";
$context["subId"] = null;
// line 376
yield " ";
if ((isset($context["subProduct"]) || array_key_exists("subProduct", $context) ? $context["subProduct"] : (function () { throw new RuntimeError('Variable "subProduct" does not exist.', 376, $this->source); })())) {
// line 377
yield " ";
$context["subId"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["subProduct"]) || array_key_exists("subProduct", $context) ? $context["subProduct"] : (function () { throw new RuntimeError('Variable "subProduct" does not exist.', 377, $this->source); })()), "id", [], "any", false, false, false, 377);
// line 378
yield " ";
}
// line 379
yield "
";
// line 380
if ( !CoreExtension::getAttribute($this->env, $this->source, ($context["mainCategory"] ?? null), "id", [], "any", true, true, false, 380)) {
// line 381
yield " ";
$context["mainCategory"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["productEntity"]) || array_key_exists("productEntity", $context) ? $context["productEntity"] : (function () { throw new RuntimeError('Variable "productEntity" does not exist.', 381, $this->source); })()), "mainCategory", [], "any", false, false, false, 381);
// line 382
yield " ";
}
// line 383
yield "
";
// line 384
$context["subtotal"] = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["product"], "vars", [], "any", false, false, false, 384), "value", [], "any", false, false, false, 384), "getSubtotal", [], "any", false, false, false, 384);
// line 385
yield " ";
$context["total"] = ((isset($context["total"]) || array_key_exists("total", $context) ? $context["total"] : (function () { throw new RuntimeError('Variable "total" does not exist.', 385, $this->source); })()) + (isset($context["subtotal"]) || array_key_exists("subtotal", $context) ? $context["subtotal"] : (function () { throw new RuntimeError('Variable "subtotal" does not exist.', 385, $this->source); })()));
// line 386
yield "
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['product'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 388
yield "
<div class=\"columns\">
<div class=\"column is-9\">
<h1 class=\"cart-right-side\">
";
// line 392
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("cart", [], "store"), "html", null, true);
yield "
</h1>
<br/>
<table class=\"table is-fullwidth cart-products\">
<tbody>
";
// line 400
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 400, $this->source); })()), "products", [], "any", false, false, false, 400));
foreach ($context['_seq'] as $context["_key"] => $context["product"]) {
// line 401
yield " ";
$context["productEntity"] = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["product"], "product", [], "any", false, false, false, 401), "vars", [], "any", false, false, false, 401), "data", [], "any", false, false, false, 401);
// line 402
yield " ";
$context["subProduct"] = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["product"], "subProduct", [], "any", false, false, false, 402), "vars", [], "any", false, false, false, 402), "data", [], "any", false, false, false, 402);
// line 403
yield " ";
$context["subId"] = null;
// line 404
yield " ";
if ((isset($context["subProduct"]) || array_key_exists("subProduct", $context) ? $context["subProduct"] : (function () { throw new RuntimeError('Variable "subProduct" does not exist.', 404, $this->source); })())) {
// line 405
yield " ";
$context["subId"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["subProduct"]) || array_key_exists("subProduct", $context) ? $context["subProduct"] : (function () { throw new RuntimeError('Variable "subProduct" does not exist.', 405, $this->source); })()), "id", [], "any", false, false, false, 405);
// line 406
yield " ";
}
// line 407
yield " <tr>
<td valign=\"middle\">
<a href=\"";
// line 409
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("product", ["sub" => (isset($context["subId"]) || array_key_exists("subId", $context) ? $context["subId"] : (function () { throw new RuntimeError('Variable "subId" does not exist.', 409, $this->source); })()), "id" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["productEntity"]) || array_key_exists("productEntity", $context) ? $context["productEntity"] : (function () { throw new RuntimeError('Variable "productEntity" does not exist.', 409, $this->source); })()), "id", [], "any", false, false, false, 409), "slug" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["productEntity"]) || array_key_exists("productEntity", $context) ? $context["productEntity"] : (function () { throw new RuntimeError('Variable "productEntity" does not exist.', 409, $this->source); })()), "slug", [], "any", false, false, false, 409)]), "html", null, true);
yield "\">
";
// line 410
$context["mainPhoto"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["productEntity"]) || array_key_exists("productEntity", $context) ? $context["productEntity"] : (function () { throw new RuntimeError('Variable "productEntity" does not exist.', 410, $this->source); })()), "getMainPhotoPath", [CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 410, $this->source); })()), "request", [], "any", false, false, false, 410), "locale", [], "any", false, false, false, 410)], "method", false, false, false, 410);
// line 411
yield " ";
if (((isset($context["subProduct"]) || array_key_exists("subProduct", $context) ? $context["subProduct"] : (function () { throw new RuntimeError('Variable "subProduct" does not exist.', 411, $this->source); })()) && CoreExtension::getAttribute($this->env, $this->source, (isset($context["subProduct"]) || array_key_exists("subProduct", $context) ? $context["subProduct"] : (function () { throw new RuntimeError('Variable "subProduct" does not exist.', 411, $this->source); })()), "imageName", [], "any", false, false, false, 411))) {
// line 412
yield " ";
$context["mainPhoto"] = ("/images/product/" . CoreExtension::getAttribute($this->env, $this->source, (isset($context["subProduct"]) || array_key_exists("subProduct", $context) ? $context["subProduct"] : (function () { throw new RuntimeError('Variable "subProduct" does not exist.', 412, $this->source); })()), "imageName", [], "any", false, false, false, 412));
// line 413
yield " ";
}
// line 414
yield " <img style=\"min-width: 50px;!important; margin-top:20px; margin-bottom: 20px;\" src=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Liip\ImagineBundle\Templating\FilterExtension']->filter($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl((isset($context["mainPhoto"]) || array_key_exists("mainPhoto", $context) ? $context["mainPhoto"] : (function () { throw new RuntimeError('Variable "mainPhoto" does not exist.', 414, $this->source); })())), "smallCartProductCk2"), "html", null, true);
yield "\" alt=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["productEntity"]) || array_key_exists("productEntity", $context) ? $context["productEntity"] : (function () { throw new RuntimeError('Variable "productEntity" does not exist.', 414, $this->source); })()), "name", [], "any", false, false, false, 414), "html", null, true);
yield "\" class=\"product-image\">
</a>
</td>
<td class=\"product-price-col\" valign=\"middle\" style=\"width: 50%;\">
<div style=\"display: none\">
";
// line 419
yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, $context["product"], "product", [], "any", false, false, false, 419), 'row', ["attr" => ["class" => "form-control", "label" => false]]);
yield "
";
// line 420
yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, $context["product"], "subProduct", [], "any", false, false, false, 420), 'row', ["attr" => ["class" => "form-control", "label" => false]]);
yield "
</div>
<span class=\"product-price-special\">
<a href=\"";
// line 423
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("product", ["sub" => (isset($context["subId"]) || array_key_exists("subId", $context) ? $context["subId"] : (function () { throw new RuntimeError('Variable "subId" does not exist.', 423, $this->source); })()), "id" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["productEntity"]) || array_key_exists("productEntity", $context) ? $context["productEntity"] : (function () { throw new RuntimeError('Variable "productEntity" does not exist.', 423, $this->source); })()), "id", [], "any", false, false, false, 423), "slug" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["productEntity"]) || array_key_exists("productEntity", $context) ? $context["productEntity"] : (function () { throw new RuntimeError('Variable "productEntity" does not exist.', 423, $this->source); })()), "slug", [], "any", false, false, false, 423)]), "html", null, true);
yield "\" style=\"font-weight: 600;\" class=\"product-title-cart\">
";
// line 424
if ((isset($context["subProduct"]) || array_key_exists("subProduct", $context) ? $context["subProduct"] : (function () { throw new RuntimeError('Variable "subProduct" does not exist.', 424, $this->source); })())) {
// line 425
yield " ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["subProduct"]) || array_key_exists("subProduct", $context) ? $context["subProduct"] : (function () { throw new RuntimeError('Variable "subProduct" does not exist.', 425, $this->source); })()), "name", [], "any", false, false, false, 425), "html", null, true);
yield "
";
} else {
// line 427
yield " ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["productEntity"]) || array_key_exists("productEntity", $context) ? $context["productEntity"] : (function () { throw new RuntimeError('Variable "productEntity" does not exist.', 427, $this->source); })()), "name", [], "any", false, false, false, 427), "html", null, true);
yield "
";
}
// line 429
yield " </a>
<br/>
";
// line 431
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["product"], "vars", [], "any", false, false, false, 431), "value", [], "any", false, false, false, 431), "equipments", [], "any", false, false, false, 431));
foreach ($context['_seq'] as $context["_key"] => $context["cartProductEquipment"]) {
// line 432
yield " <span style=\"font-size:12px\">
";
// line 433
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["cartProductEquipment"], "equipment", [], "any", false, false, false, 433), "name", [], "any", false, false, false, 433), "html", null, true);
yield " <strong>+";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['App\Twig\AppExtension']->formatPrice(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["cartProductEquipment"], "equipment", [], "any", false, false, false, 433), "price", [], "any", false, false, false, 433), (isset($context["currency"]) || array_key_exists("currency", $context) ? $context["currency"] : (function () { throw new RuntimeError('Variable "currency" does not exist.', 433, $this->source); })())), "html", null, true);
yield "</strong><br/>
</span>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['cartProductEquipment'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 436
yield "
";
// line 437
if ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["productEntity"]) || array_key_exists("productEntity", $context) ? $context["productEntity"] : (function () { throw new RuntimeError('Variable "productEntity" does not exist.', 437, $this->source); })()), "shippingCategory", [], "any", false, false, false, 437) && (CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 437, $this->source); })()), "request", [], "any", false, false, false, 437), "locale", [], "any", false, false, false, 437) == "pl"))) {
// line 438
yield " ";
$context["sc"] = (CoreExtension::getAttribute($this->env, $this->source, (isset($context["productEntity"]) || array_key_exists("productEntity", $context) ? $context["productEntity"] : (function () { throw new RuntimeError('Variable "productEntity" does not exist.', 438, $this->source); })()), "shippingCategory", [], "any", false, false, false, 438) . "_store");
// line 439
yield " <a target=\"_blank\" href=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("single_article", ["id" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["shoppingArticle"]) || array_key_exists("shoppingArticle", $context) ? $context["shoppingArticle"] : (function () { throw new RuntimeError('Variable "shoppingArticle" does not exist.', 439, $this->source); })()), "id", [], "any", false, false, false, 439), "slug" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["shoppingArticle"]) || array_key_exists("shoppingArticle", $context) ? $context["shoppingArticle"] : (function () { throw new RuntimeError('Variable "shoppingArticle" does not exist.', 439, $this->source); })()), "slug", [], "any", false, false, false, 439)]), "html", null, true);
yield "\">
<div style=\"margin-top:10px; font-weight: normal; text-align: left; font-size: 14px;\" class=\"step_txt\">
";
// line 441
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans((isset($context["sc"]) || array_key_exists("sc", $context) ? $context["sc"] : (function () { throw new RuntimeError('Variable "sc" does not exist.', 441, $this->source); })()), [], "store"), "html", null, true);
yield "
</div>
</a>
";
}
// line 445
yield " </span>
<div style=\"";
// line 446
if (Twig\Extension\CoreExtension::length($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["product"], "vars", [], "any", false, false, false, 446), "value", [], "any", false, false, false, 446), "parameterValues", [], "any", false, false, false, 446))) {
yield "margin-top:20px;";
}
yield " font-size:13px;\">
<div style=\"display: none\">
";
// line 448
CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["product"], "variant", [], "any", false, false, false, 448), "setRendered", [], "any", false, false, false, 448);
// line 449
yield " </div>
<div>
";
// line 451
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["product"], "vars", [], "any", false, false, false, 451), "value", [], "any", false, false, false, 451), "parameterValues", [], "any", false, false, false, 451));
foreach ($context['_seq'] as $context["_key"] => $context["value"]) {
// line 452
yield " <strong>";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["value"], "parameter", [], "any", false, false, false, 452), "name", [], "any", false, false, false, 452), "html", null, true);
yield "</strong>: ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["value"], "parameterValue", [], "any", false, false, false, 452), "name", [], "any", false, false, false, 452), "html", null, true);
yield "<br/>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['value'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 454
yield " </div>
</div>
</td>
<td>
<div class=\"custom-quantity-input\">
";
// line 459
yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, $context["product"], "quantity", [], "any", false, false, false, 459), 'row', ["attr" => ["class" => "input quantity-input commaReplacer", "data-record" => CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["product"], "vars", [], "any", false, false, false, 459), "value", [], "any", false, false, false, 459), "id", [], "any", false, false, false, 459), "data-product" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["productEntity"]) || array_key_exists("productEntity", $context) ? $context["productEntity"] : (function () { throw new RuntimeError('Variable "productEntity" does not exist.', 459, $this->source); })()), "id", [], "any", false, false, false, 459), "label" => false]]);
yield "
";
// line 460
$context["quantityTotal"] = ((isset($context["quantityTotal"]) || array_key_exists("quantityTotal", $context) ? $context["quantityTotal"] : (function () { throw new RuntimeError('Variable "quantityTotal" does not exist.', 460, $this->source); })()) + CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["product"], "quantity", [], "any", false, false, false, 460), "vars", [], "any", false, false, false, 460), "value", [], "any", false, false, false, 460));
// line 461
yield " </div>
<div class=\"loader_group\" style=\"text-align: center; margin-top:20px; margin-left:-8px; display: none\" id=\"quantity_loader_";
// line 462
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["productEntity"]) || array_key_exists("productEntity", $context) ? $context["productEntity"] : (function () { throw new RuntimeError('Variable "productEntity" does not exist.', 462, $this->source); })()), "id", [], "any", false, false, false, 462), "html", null, true);
yield "\">
<i class=\"fas fa-spinner fa-spin\"></i>
</div>
</td>
<td class=\"product-price-col\" style=\"min-width: 110px;\">
<span class=\"product-price-special\">
";
// line 468
if ( !CoreExtension::getAttribute($this->env, $this->source, ($context["mainCategory"] ?? null), "id", [], "any", true, true, false, 468)) {
// line 469
yield " ";
$context["mainCategory"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["productEntity"]) || array_key_exists("productEntity", $context) ? $context["productEntity"] : (function () { throw new RuntimeError('Variable "productEntity" does not exist.', 469, $this->source); })()), "mainCategory", [], "any", false, false, false, 469);
// line 470
yield " ";
}
// line 471
yield " ";
yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, $context["product"], "price", [], "any", false, false, false, 471), 'row', ["attr" => ["class" => "form-control", "label" => false]]);
yield "
<div style=\"display: none\">
";
// line 473
yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, $context["product"], "currency", [], "any", false, false, false, 473), 'row', ["attr" => ["class" => "form-control", "label" => false]]);
yield "
</div>
";
// line 475
$context["currency"] = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["product"], "currency", [], "any", false, false, false, 475), "vars", [], "any", false, false, false, 475), "data", [], "any", false, false, false, 475);
// line 476
yield "
</span>
";
// line 478
$context["subtotal"] = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["product"], "vars", [], "any", false, false, false, 478), "value", [], "any", false, false, false, 478), "getSubtotal", [], "any", false, false, false, 478);
// line 479
yield " <span style=\"font-size:24px; font-weight: bold;\">
";
// line 480
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['App\Twig\AppExtension']->formatPrice((isset($context["subtotal"]) || array_key_exists("subtotal", $context) ? $context["subtotal"] : (function () { throw new RuntimeError('Variable "subtotal" does not exist.', 480, $this->source); })()), (isset($context["currency"]) || array_key_exists("currency", $context) ? $context["currency"] : (function () { throw new RuntimeError('Variable "currency" does not exist.', 480, $this->source); })())), "html", null, true);
yield "
</span>
</td>
<td style=\"width:60px;\">
<a style=\"cursor: pointer; font-size:24px; font-weight: normal;\" class=\"close-button btn-cart-remove\" data-record=\"";
// line 484
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["product"], "vars", [], "any", false, false, false, 484), "value", [], "any", false, false, false, 484), "id", [], "any", false, false, false, 484), "html", null, true);
yield "\" data-product=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["productEntity"]) || array_key_exists("productEntity", $context) ? $context["productEntity"] : (function () { throw new RuntimeError('Variable "productEntity" does not exist.', 484, $this->source); })()), "id", [], "any", false, false, false, 484), "html", null, true);
yield "\"><i class=\"fa fa-times\"></i> </a>
</td>
</tr>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['product'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 488
yield " ";
CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 488, $this->source); })()), "products", [], "any", false, false, false, 488), "setRendered", [], "any", false, false, false, 488);
// line 489
yield " </tbody>
</table>
<div class=\"columns\">
<div class=\"column is-12\">
<h1 class=\"cart-right-side move-right-desktop\">
";
// line 495
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("choose_delivery", [], "store"), "html", null, true);
yield "
</h1>
</div>
</div>
<div class=\"columns\">
<div class=\"column is-12\">
<div id=\"deliveryMethodsContent\">
";
// line 503
yield from $this->loadTemplate("frontend/cart/_deliveryMethods.html.twig", "frontend/cart/cart.html.twig", 503)->unwrap()->yield($context);
// line 504
yield " </div>
</div>
</div>
<div class=\"columns\">
<div class=\"column is-12\">
<div class=\"columns\">
<div class=\"column is-9\">
<h1 class=\"cart-right-side move-right-desktop\">
";
// line 514
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("choose_payment", [], "store"), "html", null, true);
yield "
</h1>
</div>
</div>
<div id=\"paymentMethodsContent\">
</div>
</div>
</div>
</div>
";
// line 526
yield from $this->loadTemplate("frontend/components/_cartRightSide.twig", "frontend/cart/cart.html.twig", 526)->unwrap()->yield(CoreExtension::merge($context, ["disableActions" => false]));
// line 527
yield " </div>
<div class=\"columns\" style=\"margin-left:-10px; margin-bottom: 30px;\">
<div class=\"column is-full\">
<a href=\"";
// line 531
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("category", ["slug" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["mainCategory"]) || array_key_exists("mainCategory", $context) ? $context["mainCategory"] : (function () { throw new RuntimeError('Variable "mainCategory" does not exist.', 531, $this->source); })()), "slug", [], "any", false, false, false, 531), "id" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["mainCategory"]) || array_key_exists("mainCategory", $context) ? $context["mainCategory"] : (function () { throw new RuntimeError('Variable "mainCategory" does not exist.', 531, $this->source); })()), "id", [], "any", false, false, false, 531)]), "html", null, true);
yield "\" style=\"font-weight: 500;\" class=\"button add-another-product-button button-back is-warning\"><i class=\"fa fa-arrow-left\"></i> ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("add_another_products", [], "store"), "html", null, true);
yield "</a>
</div>
</div>
";
// line 534
CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 534, $this->source); })()), "paymentMethod", [], "any", false, false, false, 534), "setRendered", [], "any", false, false, false, 534);
// line 535
yield " ";
CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 535, $this->source); })()), "deliveryCountry", [], "any", false, false, false, 535), "setRendered", [], "any", false, false, false, 535);
// line 536
yield " ";
CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 536, $this->source); })()), "deliveryMethod", [], "any", false, false, false, 536), "setRendered", [], "any", false, false, false, 536);
// line 537
yield " ";
yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 537, $this->source); })()), 'form_end');
yield "
</div>
</div>
";
// line 543
if (Twig\Extension\CoreExtension::length($this->env->getCharset(), (isset($context["crossSelling"]) || array_key_exists("crossSelling", $context) ? $context["crossSelling"] : (function () { throw new RuntimeError('Variable "crossSelling" does not exist.', 543, $this->source); })()))) {
// line 544
yield "
<h1 class=\"cart-right-side\" style=\"margin-bottom: 30px;\">
";
// line 546
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("others_bought_also", [], "store"), "html", null, true);
yield "
</h1>
<div class=\"columns is-multiline is-mobile lista-produktow\" v-match-heights=\"{ el: [ '.no-description' ] }\">
";
// line 550
if (((isset($context["crossSelling"]) || array_key_exists("crossSelling", $context) ? $context["crossSelling"] : (function () { throw new RuntimeError('Variable "crossSelling" does not exist.', 550, $this->source); })()) == 0)) {
// line 551
yield "
";
} else {
// line 553
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(Twig\Extension\CoreExtension::slice($this->env->getCharset(), (isset($context["crossSelling"]) || array_key_exists("crossSelling", $context) ? $context["crossSelling"] : (function () { throw new RuntimeError('Variable "crossSelling" does not exist.', 553, $this->source); })()), 0, 4));
$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["productData"]) {
// line 554
yield " ";
$context["product"] = CoreExtension::getAttribute($this->env, $this->source, $context["productData"], 0, [], "array", false, false, false, 554);
// line 555
yield " ";
yield from $this->loadTemplate("frontend/components/smallProduct.html.twig", "frontend/cart/cart.html.twig", 555)->unwrap()->yield(CoreExtension::merge($context, ["isOneQuarter" => 1, "product" => (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 555, $this->source); })()), "productData" => $context["productData"]]));
// line 556
yield " ";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['productData'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 557
yield " ";
}
// line 558
yield " </div>
";
}
// line 560
yield "
</div>
</section>
</div>
</div>
";
} else {
// line 567
yield " ";
yield from $this->loadTemplate("frontend/components/notification.html.twig", "frontend/cart/cart.html.twig", 567)->unwrap()->yield($context);
// line 568
yield "
";
// line 569
if ((isset($context["showNotification"]) || array_key_exists("showNotification", $context) ? $context["showNotification"] : (function () { throw new RuntimeError('Variable "showNotification" does not exist.', 569, $this->source); })())) {
// line 570
yield " <div class=\"notification is-danger cart-error-notification\" style=\"text-align: center!important; margin:40px; display: block!important;\">
";
// line 571
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("products_deleted_info", [], "store"), "html", null, true);
yield "
</div>
";
}
// line 574
yield "
<div class=\"review-comments\" style=\"margin-top:30px; margin-bottom:30px; text-align: center\">
<h1>
";
// line 577
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("your_cart_is_empty", [], "store"), "html", null, true);
yield "
</h1>
</div>
";
}
// line 581
yield "
<div class=\"modal\" id=\"modal-choose-delivery\">
<div class=\"modal-background\"></div>
<div class=\"modal-content\">
<div class=\"box\" style=\"padding:20px!important;\">
<p style=\"text-align: center\">
";
// line 587
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("please_choose_form_delivery_and_payment", [], "store"), "html", null, true);
yield "
<br/>
<button style=\"margin-top:20px; color: #fff!important; border-color: transparent!important; font-weight: bold; font-size: 17px!important; background: #44bc42;\" class=\"button close-modal-custom is-success\">";
// line 589
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ok_got_it", [], "store"), "html", null, true);
yield "</button>
</p>
</div>
</div>
<button class=\"modal-close is-large\" aria-label=\"close\"></button>
</div>
";
// line 596
$context["criteoCount"] = 0;
// line 597
yield "
";
// line 598
if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 598, $this->source); })()), "request", [], "any", false, false, false, 598), "locale", [], "any", false, false, false, 598) == "pl")) {
// line 599
yield " <script type=\"text/javascript\" src=\"//static.criteo.net/js/ld/ld.js\" async=\"true\"></script>
<script type=\"text/javascript\">
window.criteo_q = window.criteo_q || [];
var deviceType = /iPad/.test(navigator.userAgent) ? \"t\" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? \"m\" : \"d\";
window.criteo_q.push(
{ event: \"setAccount\", account: 36267 },
{ event: \"setEmail\", email: \"";
// line 605
if (CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "user", [], "any", false, true, false, 605), "email", [], "any", true, true, false, 605)) {
yield " ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 605, $this->source); })()), "user", [], "any", false, false, false, 605), "email", [], "any", false, false, false, 605), "html", null, true);
yield " ";
}
yield "\" },
{ event: \"setSiteType\", type: deviceType },
{ event: \"viewBasket\", item: [
";
// line 608
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["cartProducts"]) || array_key_exists("cartProducts", $context) ? $context["cartProducts"] : (function () { throw new RuntimeError('Variable "cartProducts" does not exist.', 608, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
$context["criteoCount"] = ((isset($context["criteoCount"]) || array_key_exists("criteoCount", $context) ? $context["criteoCount"] : (function () { throw new RuntimeError('Variable "criteoCount" does not exist.', 608, $this->source); })()) + 1);
if (((isset($context["criteoCount"]) || array_key_exists("criteoCount", $context) ? $context["criteoCount"] : (function () { throw new RuntimeError('Variable "criteoCount" does not exist.', 608, $this->source); })()) != (isset($context["countCriteoProducts"]) || array_key_exists("countCriteoProducts", $context) ? $context["countCriteoProducts"] : (function () { throw new RuntimeError('Variable "countCriteoProducts" does not exist.', 608, $this->source); })()))) {
yield "{ id: \"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["item"], "product", [], "any", false, false, false, 608), "id", [], "any", false, false, false, 608), "html", null, true);
yield "\", price: ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "price", [], "any", false, false, false, 608), "html", null, true);
yield ", quantity: ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "quantity", [], "any", false, false, false, 608), "html", null, true);
yield " },";
} else {
yield "{ id: \"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["item"], "product", [], "any", false, false, false, 608), "getId", [], "any", false, false, false, 608), "html", null, true);
yield "\", price: ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "price", [], "any", false, false, false, 608), "html", null, true);
yield ", quantity: ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "quantity", [], "any", false, false, false, 608), "html", null, true);
yield " }";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['item'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 609
yield " ]}
);
</script>
<script type=\"text/javascript\">
var google_tag_params = {
ecomm_pagetype: 'cart'
};
</script>
";
}
// line 619
yield "
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "frontend/cart/cart.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 1180 => 619, 1168 => 609, 1142 => 608, 1132 => 605, 1124 => 599, 1122 => 598, 1119 => 597, 1117 => 596, 1107 => 589, 1102 => 587, 1094 => 581, 1087 => 577, 1082 => 574, 1076 => 571, 1073 => 570, 1071 => 569, 1068 => 568, 1065 => 567, 1056 => 560, 1052 => 558, 1049 => 557, 1035 => 556, 1032 => 555, 1029 => 554, 1011 => 553, 1007 => 551, 1005 => 550, 998 => 546, 994 => 544, 992 => 543, 982 => 537, 979 => 536, 976 => 535, 974 => 534, 966 => 531, 960 => 527, 958 => 526, 943 => 514, 931 => 504, 929 => 503, 918 => 495, 910 => 489, 907 => 488, 895 => 484, 888 => 480, 885 => 479, 883 => 478, 879 => 476, 877 => 475, 872 => 473, 866 => 471, 863 => 470, 860 => 469, 858 => 468, 849 => 462, 846 => 461, 844 => 460, 840 => 459, 833 => 454, 822 => 452, 818 => 451, 814 => 449, 812 => 448, 805 => 446, 802 => 445, 795 => 441, 789 => 439, 786 => 438, 784 => 437, 781 => 436, 770 => 433, 767 => 432, 763 => 431, 759 => 429, 753 => 427, 747 => 425, 745 => 424, 741 => 423, 735 => 420, 731 => 419, 720 => 414, 717 => 413, 714 => 412, 711 => 411, 709 => 410, 705 => 409, 701 => 407, 698 => 406, 695 => 405, 692 => 404, 689 => 403, 686 => 402, 683 => 401, 679 => 400, 668 => 392, 662 => 388, 655 => 386, 652 => 385, 650 => 384, 647 => 383, 644 => 382, 641 => 381, 639 => 380, 636 => 379, 633 => 378, 630 => 377, 627 => 376, 624 => 375, 621 => 374, 619 => 373, 616 => 372, 612 => 371, 609 => 370, 606 => 369, 603 => 368, 601 => 367, 598 => 366, 596 => 365, 581 => 353, 563 => 338, 545 => 323, 525 => 306, 521 => 305, 514 => 300, 508 => 297, 505 => 296, 503 => 295, 490 => 284, 488 => 283, 482 => 280, 478 => 279, 473 => 278, 467 => 276, 464 => 275, 458 => 273, 452 => 271, 449 => 270, 447 => 269, 443 => 268, 439 => 267, 435 => 266, 431 => 265, 427 => 264, 424 => 263, 417 => 261, 414 => 260, 412 => 259, 409 => 258, 405 => 257, 402 => 256, 399 => 255, 397 => 254, 394 => 253, 381 => 252, 178 => 59, 165 => 58, 107 => 11, 94 => 10, 79 => 6, 66 => 5, 43 => 1,);
}
public function getSourceContext(): Source
{
return new Source("{% extends 'base.html.twig' %}
{% trans_default_domain 'store' %}
{% block facebook %}
{{ parent() }}
<META NAME=\"ROBOTS\" CONTENT=\"NOINDEX, NOFOLLOW\">
{% endblock %}
{% block stylesheets %}
{{ parent() }}
<style>
.table td, .table th {
vertical-align: middle!important;
padding-left:5px!important;
}
@media screen and (min-width: 769px) and (max-width:1024px) {
.column.is-9 {
width:70% !important;
}
}
.custom-radio-wrapper{
display:flex;
align-items:flex-start; /* keeps radio button and text aligned */
border-radius:4px;
cursor:pointer;
}
.custom-radio-wrapper .custom-radio-container{
display:flex;
align-items:flex-start;
}
/* title line */
.payment-title{
font-size:1rem; /* ~16 px */
font-weight:500;
line-height:1.3;
display:block;
}
/* extra info line */
.payment-desc{
font-size:.8125rem; /* ~13 px */
color:#666;
line-height:1.25;
display:block; /* forces a new line */
margin-top:.125rem;
}
</style>
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script>
\$(document ).ready(function() {
function colorize(element, className) {
console.log('colorize');
\$(\".\"+className+\" tbody tr\").each(function(){
console.log(\$(this));
\$(this).css('border', '1px solid #dbdbdb');
});
\$(\".\"+className+\" tbody tr\").css('border', '1px solid #dbdbdb');
element.closest('tr').css('border', '2px solid #44bc42');
}
/* Change quantity of the ordered product */
\$(document).on('input', '.quantity-input', function (e) {
var product = \$(this).attr('data-product');
var url = \$('#update_quantity_cart').val();
var record = \$(this).attr('data-record');
var quantity = \$(this).val();
\$('#quantity_loader_'+product).show();
\$.ajax({
url: url,
type:\"POST\",
data:{'record_id':record, 'quantity':quantity, 'product_id':product},
success:function (data) {
console.log(data);
if (parseInt(data.error) === 1) {
\$('.cart-error-notification').show();
\$('.cart-error-notification').html(data.message);
\$(\"html, body\").animate({ scrollTop: \$('.cart-error-notification').offset().top }, 200);
}
\$('.loader_group').hide();
var cartUrl = \$('#cart_url').val();
\$('#cart-table').load(cartUrl+' #cart-table', {}, function(response) {
calculateSum();
});
}
});
});
/* Trigger click of first element id delivery list */
\$(\"input:radio[name=deliveryMethod]:first\").trigger(\"click\");
colorize(\$(\"input:radio[name=deliveryMethod]:first\"), 'delivery-methods-table');
var \$deliveryMethodContent = \$('#deliveryMethodsContent');
var \$paymentMethodContainer = \$('#paymentMethodsContent');
var loadPaymentMethods = function() {
var id = \$('.deliveryMethod').val();
\$paymentMethodContainer.html(' ');
var url = \$('#load_payment_methods').val();
\$paymentMethodContainer.load(url, {'id':id}, function() {
calculateSum();
});
}
loadPaymentMethods();
/* Removes element from cart */
\$(document).on('click', '.btn-cart-remove', 'click', function (e) {
var url = \$('#remove_cart_url').val();
var record = \$(this).attr('data-record');
var product = \$(this).attr('data-product');
var productId = \$(this).attr('data-id');
\$('#quantity_loader_'+product).show();
\$.ajax({
url: url,
type:\"POST\",
data:{'record_id':record, 'product_id':product},
success:function (data) {
console.log(data);
\$('.loader_group').hide();
var cartUrl = \$('#cart_url').val();
\$('.cart-products').load(cartUrl+' .cart-products', {}, function(response) {
console.log(response);
});
calculateSum();
}
});
});
/** Change country -> release load form od delviery */
\$(document).on('change', '#country', function (e) {
\$deliveryMethodContent.html(' ');
\$paymentMethodContainer.html(' ');
\$('#country_id').val(\$(this).val());
var url = \$('#load_delivery_methods').val();
\$deliveryMethodContent.load(url, {'id':\$(this).val()}, function() {
\$(\"input:radio[name=deliveryMethod]:first\").trigger(\"click\");
});
});
/** Load payment methods */
\$(document).on('change', '.deliveryMethod', function (e) {
colorize(\$(this), 'delivery-methods-table');
loadPaymentMethods();
});
/**
* Dynamically calculate total sum of product and dlivery + payment method
*/
var calculateSum = function () {
var deliveryId = \$('input[name=deliveryMethod]:checked').val();
var paymentId = \$('input[name=paymentMethod]:checked').val();
var url = \$('#ajax_calculate_sum').val();
\$.ajax({
url: url,
type:\"POST\",
data:{'deliveryId':deliveryId, 'paymentId':paymentId},
success:function (data) {
console.log(data);
\$('.totalSum').html(data.sum);
if (\$('.totalSumWithRebate').length) {
\$('.totalSumWithRebate').html(data.sumWithRebate);
}
if (\$('.totalSumWithoutRebate').length) {
\$('.totalSumWithoutRebate').html(data.sum);
}
if (\$('.savingsInfo').length) {
\$('.savingsInfo').html(data.savings);
}
}
});
}
/** Handle payment method change */
\$(document).on('click', '.paymentMethod', function (e) {
colorize(\$(this), 'payment-methods-table');
});
\$(document).on('click', '.deliveryMethod', function (e) {
colorize(\$(this), 'delivery-methods-table');
});
\$(document).on('change', '.paymentMethod', function (e) {
colorize(\$(this), 'payment-methods-table');
calculateSum();
});
\$(document).on(\"click\", \"#go-to-request-form\", \"click\", function() {
var urlRedirect = \$('#send_request_url').val();
window.location.href = urlRedirect;
});
\$(document).on('click', '.go-to-checkout', 'click', function (e) {
e.preventDefault();
var deliveryId = \$('input[name=deliveryMethod]:checked').val();
var paymentId = \$('input[name=paymentMethod]:checked').val();
if (deliveryId && paymentId) {
var url = \$('#ajax_save_cart').val();
\$.ajax({
url: url,
type:\"POST\",
data:{'deliveryId':deliveryId, 'paymentId':paymentId},
success:function (data) {
window.location.href = \$('#checkout_redirect').val();
}
});
} else {
\$(\"#modal-choose-delivery\").addClass(\"is-active\");
}
});
});
\$('.modal-close').click(function() {
\$(\"#modal-choose-delivery\").removeClass(\"is-active\");
});
\$('.close-modal-custom').click(function() {
\$(\"#modal-choose-delivery\").removeClass(\"is-active\");
});
</script>
{% endblock %}
{% block content %}
{% set countCriteoProducts = 0 %}
{% set criteoIds = [] %}
{% for product in cartProducts %}
{% set criteoIds = criteoIds|merge([product.id]) %}
{% set countCriteoProducts = countCriteoProducts + 1 %}
{% endfor %}
<input type=\"hidden\" id=\"load_delivery_methods\" value=\"{{ path('load_delivery_methods') }}\"/>
<input type=\"hidden\" id=\"load_payment_methods\" value=\"{{ path('load_payment_methods') }}\"/>
<input type=\"hidden\" id=\"ajax_calculate_sum\" value=\"{{ path('ajax_calculate_sum') }}\"/>
<input type=\"hidden\" id=\"ajax_save_cart\" value=\"{{ path('ajax_save_cart') }}\"/>
<input type=\"hidden\" id=\"send_request_url\" value=\"{{ path('send_request') }}\"/>
{% if app.user.id is defined %}
{% if app.user.hasRole('ROLE_CUSTOMER_REGISTERED') %}
<input type=\"hidden\" id=\"checkout_redirect\" value=\"{{ path('register') }}\"/>
{% else %}
<input type=\"hidden\" id=\"checkout_redirect\" value=\"{{ path('summary') }}\"/>
{% endif %}
{% else %}
<input type=\"hidden\" id=\"checkout_redirect\" value=\"{{ path('register_login') }}\"/>
{% endif %}
<input type=\"hidden\" id=\"cart_url\" value=\"{{ path('cart') }}\"/>
<input type=\"hidden\" id=\"remove_cart_url\" value=\"{{ path('remove_from_cart') }}\"/>
<input type=\"hidden\" id=\"update_quantity_cart\" value=\"{{ path('update_quantity_cart') }}\"/>
{% if cartProducts|length > 0 %}
<div class=\"row\" style=\"margin-top:20px;\">
<div class=\"col-sm-12\">
<section id=\"content\" role=\"main\">
<div class=\"container\">
<div class=\"row\">
<div class=\"\">
{% if showNotification %}
<div class=\"notification is-danger cart-error-notification\" style=\"text-align: center!important; margin:40px; display: block!important;\">
{{ 'products_deleted_info'|trans }}
</div>
{% endif %}
<div class=\"notification is-danger cart-error-notification\" style=\"text-align: center; display: none\">
</div>
{{ form_errors(form) }}
{{ form_start(form, {'attr': {'id':'cart-form', 'method':'post', 'role':'form', 'novalidate': 'novalidate'}}) }}
<!-- START OF INFOGRAPHIC SECTION -->
<section class=\"section is-hidden-touch\">
<div class=\"container\">
<div class=\"columns is-center is-centered\">
<div class=\"column column-cart is-one-third\">
<div style=\"display: inline-block;\">
<div class=\"step_nr_new active\">
<i class=\"fa fa-check\"></i>
</div>
</div>
<div class=\"column is-narrow\" style=\"display: inline-block\">
<div class=\"step_txt active\">
{{ 'cart'|trans }}
</div>
<div class=\"\" style=\"width: 200px;\">
<hr class=\"cart-hr-active\">
</div>
</div>
</div>
<div class=\"column column-cart is-one-third column-back\">
<div style=\"display: inline-block;\">
<div class=\"step_nr_new\">
</div>
</div>
<div class=\"column is-narrow\" style=\"display: inline-block\">
<div class=\"step_txt\">
{{ 'shipping_data'|trans }}
</div>
<div class=\"\" style=\"width: 200px;\">
<hr class=\"cart-hr\">
</div>
</div>
</div>
<div class=\"column column-cart is-one-third column-back\">
<div style=\"display: inline-block;\">
<div class=\"step_nr_new\">
</div>
</div>
<div class=\"column is-narrow\" style=\"display: inline-block\">
<div class=\"step_txt\">
{{ 'summary'|trans }}
</div>
<div class=\"\" style=\"width: 200px;\">
<hr class=\"cart-hr\">
</div>
</div>
</div>
</div>
</div>
</section>
{% include 'frontend/components/notification.html.twig' %}
{% set total = 0 %}
{% set quantityTotal = 0 %}
{% set mainCategory = 0 %}
{% for product in form.products %}
{% set productEntity = product.product.vars.data %}
{% set subProduct = product.subProduct.vars.data %}
{% set subId = null %}
{% if subProduct %}
{% set subId = subProduct.id %}
{% endif %}
{% if mainCategory.id is not defined %}
{% set mainCategory = productEntity.mainCategory %}
{% endif %}
{% set subtotal = product.vars.value.getSubtotal %}
{% set total = total + subtotal %}
{% endfor %}
<div class=\"columns\">
<div class=\"column is-9\">
<h1 class=\"cart-right-side\">
{{ 'cart'|trans }}
</h1>
<br/>
<table class=\"table is-fullwidth cart-products\">
<tbody>
{% for product in form.products %}
{% set productEntity = product.product.vars.data %}
{% set subProduct = product.subProduct.vars.data %}
{% set subId = null %}
{% if subProduct %}
{% set subId = subProduct.id %}
{% endif %}
<tr>
<td valign=\"middle\">
<a href=\"{{ path('product', {'sub':subId, 'id':productEntity.id, 'slug':productEntity.slug}) }}\">
{% set mainPhoto = productEntity.getMainPhotoPath(app.request.locale) %}
{% if subProduct and subProduct.imageName %}
{% set mainPhoto = '/images/product/'~subProduct.imageName %}
{% endif %}
<img style=\"min-width: 50px;!important; margin-top:20px; margin-bottom: 20px;\" src=\"{{ asset(mainPhoto) | imagine_filter('smallCartProductCk2') }}\" alt=\"{{ productEntity.name }}\" class=\"product-image\">
</a>
</td>
<td class=\"product-price-col\" valign=\"middle\" style=\"width: 50%;\">
<div style=\"display: none\">
{{ form_row(product.product, {attr: {'class':'form-control', 'label': false}}) }}
{{ form_row(product.subProduct, {attr: {'class':'form-control', 'label': false}}) }}
</div>
<span class=\"product-price-special\">
<a href=\"{{ path('product', {'sub':subId, 'id':productEntity.id, 'slug':productEntity.slug}) }}\" style=\"font-weight: 600;\" class=\"product-title-cart\">
{% if subProduct %}
{{ subProduct.name }}
{% else %}
{{ productEntity.name }}
{% endif %}
</a>
<br/>
{% for cartProductEquipment in product.vars.value.equipments %}
<span style=\"font-size:12px\">
{{ cartProductEquipment.equipment.name }} <strong>+{{ cartProductEquipment.equipment.price|formatPrice(currency) }}</strong><br/>
</span>
{% endfor %}
{% if productEntity.shippingCategory and app.request.locale == 'pl' %}
{% set sc = productEntity.shippingCategory~'_store' %}
<a target=\"_blank\" href=\"{{ path('single_article', {'id':shoppingArticle.id, 'slug':shoppingArticle.slug}) }}\">
<div style=\"margin-top:10px; font-weight: normal; text-align: left; font-size: 14px;\" class=\"step_txt\">
{{ sc|trans }}
</div>
</a>
{% endif %}
</span>
<div style=\"{% if product.vars.value.parameterValues|length %}margin-top:20px;{% endif %} font-size:13px;\">
<div style=\"display: none\">
{% do product.variant.setRendered %}
</div>
<div>
{% for value in product.vars.value.parameterValues %}
<strong>{{ value.parameter.name }}</strong>: {{ value.parameterValue.name }}<br/>
{% endfor %}
</div>
</div>
</td>
<td>
<div class=\"custom-quantity-input\">
{{ form_row(product.quantity, {attr: {'class':'input quantity-input commaReplacer', 'data-record':product.vars.value.id, 'data-product':productEntity.id, 'label': false}}) }}
{% set quantityTotal = quantityTotal + product.quantity.vars.value %}
</div>
<div class=\"loader_group\" style=\"text-align: center; margin-top:20px; margin-left:-8px; display: none\" id=\"quantity_loader_{{ productEntity.id }}\">
<i class=\"fas fa-spinner fa-spin\"></i>
</div>
</td>
<td class=\"product-price-col\" style=\"min-width: 110px;\">
<span class=\"product-price-special\">
{% if mainCategory.id is not defined %}
{% set mainCategory = productEntity.mainCategory %}
{% endif %}
{{ form_row(product.price, {attr: {'class':'form-control', 'label': false}}) }}
<div style=\"display: none\">
{{ form_row(product.currency, {attr: {'class':'form-control', 'label': false}}) }}
</div>
{% set currency = product.currency.vars.data %}
</span>
{% set subtotal = product.vars.value.getSubtotal %}
<span style=\"font-size:24px; font-weight: bold;\">
{{ subtotal|formatPrice(currency) }}
</span>
</td>
<td style=\"width:60px;\">
<a style=\"cursor: pointer; font-size:24px; font-weight: normal;\" class=\"close-button btn-cart-remove\" data-record=\"{{ product.vars.value.id }}\" data-product=\"{{ productEntity.id }}\"><i class=\"fa fa-times\"></i> </a>
</td>
</tr>
{% endfor %}
{% do form.products.setRendered %}
</tbody>
</table>
<div class=\"columns\">
<div class=\"column is-12\">
<h1 class=\"cart-right-side move-right-desktop\">
{{ 'choose_delivery'|trans }}
</h1>
</div>
</div>
<div class=\"columns\">
<div class=\"column is-12\">
<div id=\"deliveryMethodsContent\">
{% include 'frontend/cart/_deliveryMethods.html.twig' %}
</div>
</div>
</div>
<div class=\"columns\">
<div class=\"column is-12\">
<div class=\"columns\">
<div class=\"column is-9\">
<h1 class=\"cart-right-side move-right-desktop\">
{{ 'choose_payment'|trans({}, 'store') }}
</h1>
</div>
</div>
<div id=\"paymentMethodsContent\">
</div>
</div>
</div>
</div>
{% include 'frontend/components/_cartRightSide.twig' with {'disableActions':false} %}
</div>
<div class=\"columns\" style=\"margin-left:-10px; margin-bottom: 30px;\">
<div class=\"column is-full\">
<a href=\"{{ path('category', {'slug':mainCategory.slug, 'id':mainCategory.id}) }}\" style=\"font-weight: 500;\" class=\"button add-another-product-button button-back is-warning\"><i class=\"fa fa-arrow-left\"></i> {{ 'add_another_products'|trans }}</a>
</div>
</div>
{% do form.paymentMethod.setRendered %}
{% do form.deliveryCountry.setRendered %}
{% do form.deliveryMethod.setRendered %}
{{ form_end(form) }}
</div>
</div>
{% if crossSelling|length %}
<h1 class=\"cart-right-side\" style=\"margin-bottom: 30px;\">
{{ 'others_bought_also'|trans }}
</h1>
<div class=\"columns is-multiline is-mobile lista-produktow\" v-match-heights=\"{ el: [ '.no-description' ] }\">
{% if crossSelling == 0 %}
{% else %}
{% for productData in crossSelling|slice(0,4) %}
{% set product = productData[0] %}
{% include 'frontend/components/smallProduct.html.twig' with {'isOneQuarter':1, 'product':product, 'productData':productData} %}
{% endfor %}
{% endif %}
</div>
{% endif %}
</div>
</section>
</div>
</div>
{% else %}
{% include 'frontend/components/notification.html.twig' %}
{% if showNotification %}
<div class=\"notification is-danger cart-error-notification\" style=\"text-align: center!important; margin:40px; display: block!important;\">
{{ 'products_deleted_info'|trans }}
</div>
{% endif %}
<div class=\"review-comments\" style=\"margin-top:30px; margin-bottom:30px; text-align: center\">
<h1>
{{ 'your_cart_is_empty'|trans }}
</h1>
</div>
{% endif %}
<div class=\"modal\" id=\"modal-choose-delivery\">
<div class=\"modal-background\"></div>
<div class=\"modal-content\">
<div class=\"box\" style=\"padding:20px!important;\">
<p style=\"text-align: center\">
{{ 'please_choose_form_delivery_and_payment'|trans }}
<br/>
<button style=\"margin-top:20px; color: #fff!important; border-color: transparent!important; font-weight: bold; font-size: 17px!important; background: #44bc42;\" class=\"button close-modal-custom is-success\">{{ 'ok_got_it'|trans }}</button>
</p>
</div>
</div>
<button class=\"modal-close is-large\" aria-label=\"close\"></button>
</div>
{% set criteoCount = 0 %}
{% if app.request.locale == 'pl' %}
<script type=\"text/javascript\" src=\"//static.criteo.net/js/ld/ld.js\" async=\"true\"></script>
<script type=\"text/javascript\">
window.criteo_q = window.criteo_q || [];
var deviceType = /iPad/.test(navigator.userAgent) ? \"t\" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? \"m\" : \"d\";
window.criteo_q.push(
{ event: \"setAccount\", account: 36267 },
{ event: \"setEmail\", email: \"{% if app.user.email is defined %} {{ app.user.email }} {% endif %}\" },
{ event: \"setSiteType\", type: deviceType },
{ event: \"viewBasket\", item: [
{% for item in cartProducts %}{% set criteoCount = criteoCount + 1 %}{% if criteoCount != countCriteoProducts %}{ id: \"{{ item.product.id }}\", price: {{ item.price }}, quantity: {{ item.quantity}} },{% else %}{ id: \"{{ item.product.getId }}\", price: {{ item.price }}, quantity: {{ item.quantity }} }{% endif %}{% endfor %}
]}
);
</script>
<script type=\"text/javascript\">
var google_tag_params = {
ecomm_pagetype: 'cart'
};
</script>
{% endif %}
{% endblock %}", "frontend/cart/cart.html.twig", "/home/users/ck_new/templates/frontend/cart/cart.html.twig");
}
}