<?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;
/* product/detail.html.twig */
class __TwigTemplate_6536a2e232404baad86c0840d0273ae0 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'content' => [$this, 'block_content'],
];
$this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension');
$this->checkSecurity();
}
protected function doGetParent(array $context)
{
// line 1
return $this->loadTemplate($this->extensions['App\Twig\Extension\WebsiteExtension']->getBaseLayout(), "product/detail.html.twig", 1);
}
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", "product/detail.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "product/detail.html.twig"));
// line 3
if ((( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 3, $this->source); })()), "oms", [], "any", false, false, true, 3)) && !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["subcategory"]) || array_key_exists("subcategory", $context) ? $context["subcategory"] : (function () { throw new RuntimeError('Variable "subcategory" does not exist.', 3, $this->source); })()), "oms", [], "any", false, false, true, 3))) && !twig_test_empty(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.', 3, $this->source); })()), "oms", [], "any", false, false, true, 3)))) {
// line 4
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 4, $this->source); })()), "combinedCategoryName", [], "any", false, false, true, 4))) {
// line 5
$context["categorieName"] = twig_capitalize_string_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 5, $this->source); })()), "combinedCategoryName", [], "any", false, false, true, 5), 5, $this->source));
} else {
// line 7
$context["categorieName"] = twig_capitalize_string_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 7, $this->source); })()), "oms", [], "any", false, false, true, 7), 7, $this->source));
}
// line 10
$context["head_title"] = (((($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.', 10, $this->source); })()), "oms", [], "any", false, false, true, 10), 10, $this->source) . " | ") . $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["subcategory"]) || array_key_exists("subcategory", $context) ? $context["subcategory"] : (function () { throw new RuntimeError('Variable "subcategory" does not exist.', 10, $this->source); })()), "oms", [], "any", false, false, true, 10), 10, $this->source)) . " | ") . $this->sandbox->ensureToStringAllowed((isset($context["categorieName"]) || array_key_exists("categorieName", $context) ? $context["categorieName"] : (function () { throw new RuntimeError('Variable "categorieName" does not exist.', 10, $this->source); })()), 10, $this->source));
}
// line 13
if ( !twig_test_empty(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.', 13, $this->source); })()), "extrainfo", [], "any", false, false, true, 13))) {
// line 14
$context["head_description"] = $this->extensions['App\Twig\Extension\TruncateExtension']->truncateContent($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.', 14, $this->source); })()), "extrainfo", [], "any", false, false, true, 14), 14, $this->source), 200, "...");
}
// line 1
$this->getParent($context)->display($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 17
public function block_content($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", "content"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
// line 18
echo " <div class=\"container\">
<div class=\"row\">
<div class=\"col-12 mb-3 pt-5 position-relative\">
<h3 class=\"text-primary\">";
// line 23
echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["subcategory"]) || array_key_exists("subcategory", $context) ? $context["subcategory"] : (function () { throw new RuntimeError('Variable "subcategory" does not exist.', 23, $this->source); })()), "oms", [], "any", false, false, true, 23), 23, $this->source)), "html", null, true);
echo "</h3>
<span class=\"position-absolute top-0 pt-3\">
<a href=\"";
// line 25
if ($this->extensions['App\Twig\Extension\CheckwebsiteSettingExtension']->getCheckWebsitesetting("product_document", "document")) {
echo twig_escape_filter($this->env, $this->extensions['MultilingualBundle\Twig\Extension\InotherlangExtension']->getInotherlang("LocalizedDocument", $this->extensions['Pimcore\Twig\Extension\WebsiteConfigExtension']->getWebsiteConfig("product_document")), "html", null, true);
}
echo "\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Aanbod"), "html", null, true);
echo "</a>
/
";
// line 27
$context["categoryLink"] = $this->extensions['App\Twig\Extension\ProductExtension']->generateGroupLink($this->sandbox->ensureToStringAllowed((isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 27, $this->source); })()), 27, $this->source));
// line 28
echo " <a href=\"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["categoryLink"]) || array_key_exists("categoryLink", $context) ? $context["categoryLink"] : (function () { throw new RuntimeError('Variable "categoryLink" does not exist.', 28, $this->source); })()), 28, $this->source), "html", null, true);
echo "\">
";
// line 29
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 29, $this->source); })()), "combinedCategoryName", [], "any", false, false, true, 29))) {
// line 30
echo " ";
echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 30, $this->source); })()), "combinedCategoryName", [], "any", false, false, true, 30), 30, $this->source)), "html", null, true);
echo "
";
} else {
// line 32
echo " ";
echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 32, $this->source); })()), "oms", [], "any", false, false, true, 32), 32, $this->source)), "html", null, true);
echo "
";
}
// line 34
echo " </a>
/
";
// line 36
$context["subcategoryLink"] = $this->extensions['App\Twig\Extension\ProductExtension']->generateSubGroupLink($this->sandbox->ensureToStringAllowed((isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 36, $this->source); })()), 36, $this->source), $this->sandbox->ensureToStringAllowed((isset($context["subcategory"]) || array_key_exists("subcategory", $context) ? $context["subcategory"] : (function () { throw new RuntimeError('Variable "subcategory" does not exist.', 36, $this->source); })()), 36, $this->source));
// line 37
echo " <a href=\"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["subcategoryLink"]) || array_key_exists("subcategoryLink", $context) ? $context["subcategoryLink"] : (function () { throw new RuntimeError('Variable "subcategoryLink" does not exist.', 37, $this->source); })()), 37, $this->source), "html", null, true);
echo "\">";
echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["subcategory"]) || array_key_exists("subcategory", $context) ? $context["subcategory"] : (function () { throw new RuntimeError('Variable "subcategory" does not exist.', 37, $this->source); })()), "oms", [], "any", false, false, true, 37), 37, $this->source)), "html", null, true);
echo "</a>
/
</span>
</div>
</div>
<div class=\"row justify-content-between\">
";
// line 46
if (twig_get_attribute($this->env, $this->source, ($context["product"] ?? null), "getFotos", [], "method", true, true, true, 46)) {
// line 47
echo " ";
if ((twig_length_filter($this->env, 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.', 47, $this->source); })()), "getFotos", [], "method", false, false, true, 47)) > 0)) {
// line 48
echo " <div class=\"col-12 col-lg-6 mb-3 mb-lg-0\">
<img src=\"";
// line 49
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, 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.', 49, $this->source); })()), "getFotos", [], "method", false, false, true, 49), "getThumbnail", [0 => "prod-thumb"], "method", false, false, true, 49), 49, $this->source), "html", null, true);
echo "\" class=\"img-fluid\">
</div>
";
}
// line 52
echo " ";
}
// line 53
echo "
";
// line 55
echo " ";
// line 56
echo " ";
// line 57
echo " ";
// line 58
echo " ";
// line 59
echo " ";
// line 60
echo " ";
// line 61
echo " ";
// line 62
echo " ";
// line 63
echo " ";
// line 64
echo " ";
// line 65
echo " ";
// line 66
echo " ";
// line 67
echo " ";
// line 68
echo " ";
// line 69
echo "
<div class=\"col-12 col-lg-6 ps-lg-5\">
<div class=\"row mb-3\">
<div class=\"col-12\">
<h2 class=\"text-primary\">";
// line 74
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.', 74, $this->source); })()), "oms", [], "any", false, false, true, 74), 74, $this->source), "html", null, true);
echo "</h2>
<i class=\"text-black text-opacity-50\">";
// line 75
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Code:"), "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.', 75, $this->source); })()), "code", [], "any", false, false, true, 75), 75, $this->source), "html", null, true);
echo "</i><br>
";
// line 76
if ( !twig_test_empty(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.', 76, $this->source); })()), "merk", [], "any", false, false, true, 76))) {
// line 77
echo " <span>";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Merk:"), "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.', 77, $this->source); })()), "merk", [], "any", false, false, true, 77), 77, $this->source), "html", null, true);
echo "</span><br>
";
}
// line 79
echo " <div class=\"mt-3\">
";
// line 80
echo $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.', 80, $this->source); })()), "extrainfo", [], "any", false, false, true, 80), 80, $this->source);
echo "</div>
</div>
</div>
<div class=\"row mb-5\">
<div class=\"col-12\">
";
// line 101
echo "
";
// line 102
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.', 102, $this->source); })()), "productAPE", [], "any", false, false, true, 102)) {
// line 103
echo " ";
$context["productUnit"] = 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.', 103, $this->source); })()), "APEeenheid", [], "any", false, false, true, 103);
// line 104
echo " ";
} else {
// line 105
echo " ";
$context["productUnit"] = "stuk(s)";
// line 106
echo " ";
}
// line 107
echo "
";
// line 108
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.', 108, $this->source); })()), "stock", [], "any", false, false, true, 108) <= 0)) {
// line 109
echo " <p><span class=\"stockrood me-1\">
<i class=\"fas fa-xs fa-circle\"></i>
</span>";
// line 111
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("momenteel niet voorradig *");
echo "</p>
";
} elseif ((twig_get_attribute($this->env, $this->source, // line 112
(isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 112, $this->source); })()), "stock", [], "any", false, false, true, 112) <= 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.', 112, $this->source); })()), "aantalVerkochtLaatsteMaand", [], "any", false, false, true, 112))) {
// line 113
echo " <span class=\"stockoranje ms-1\">
<i class=\"fas fa-xs fa-circle\"></i>
";
// line 115
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Beperkt op voorraad, er zijn momenteel ");
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.', 115, $this->source); })()), "stock", [], "any", false, false, true, 115), 115, $this->source), "html", null, true);
echo " ";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($this->sandbox->ensureToStringAllowed((isset($context["productUnit"]) || array_key_exists("productUnit", $context) ? $context["productUnit"] : (function () { throw new RuntimeError('Variable "productUnit" does not exist.', 115, $this->source); })()), 115, $this->source));
echo " ";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(" in voorraad. *");
echo "</span>
";
} elseif ((twig_get_attribute($this->env, $this->source, // line 116
(isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 116, $this->source); })()), "stock", [], "any", false, false, true, 116) > 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.', 116, $this->source); })()), "aantalVerkochtLaatsteMaand", [], "any", false, false, true, 116))) {
// line 117
echo " <span class=\"stockgroen ms-1\">
<i class=\"fas fa-xs fa-circle\"></i>
";
// line 119
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Voldoende voorraad, er zijn momenteel ");
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.', 119, $this->source); })()), "stock", [], "any", false, false, true, 119), 119, $this->source), "html", null, true);
echo " ";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($this->sandbox->ensureToStringAllowed((isset($context["productUnit"]) || array_key_exists("productUnit", $context) ? $context["productUnit"] : (function () { throw new RuntimeError('Variable "productUnit" does not exist.', 119, $this->source); })()), 119, $this->source));
echo " ";
echo $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(" in voorraad. *");
echo "</span>
";
}
// line 121
echo "
</div>
</div>
<script>
\$(document).ready(function(){
\$(\"#myModal\").modal('show');
});
</script>
";
// line 137
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.', 137, $this->source); })()), "stock", [], "any", false, false, true, 137) <= 0)) {
// line 138
echo " <div id=\"myModal\" class=\"modal fade\" tabindex=\"-1\">
<div class=\"modal-dialog\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h5 class=\"modal-title\">";
// line 142
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Momenteel niet op voorraad"), "html", null, true);
echo "</h5>
<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>
</div>
<div class=\"modal-body\">
<p>";
// line 146
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Opgepast, dit product is momenteel niet op voorraad en levering kan langer duren dan gebruikelijk."), "html", null, true);
echo "</p>
</div>
<div class=\"modal-footer\">
<button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">";
// line 149
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Oke"), "html", null, true);
echo "</button>
</div>
</div>
</div>
</div>
";
}
// line 155
echo "
<div class=\"row\">
<div class=\"col-12\">
";
// line 159
if (twig_get_attribute($this->env, $this->source, ($context["product"] ?? null), "promoprijs", [], "any", true, true, true, 159)) {
// line 160
echo " <div class=\"p-3 bg-light-grey bg-opacity-50 w-75 mb-3\">
";
// line 161
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.', 161, $this->source); })()), "promoprijs", [], "any", false, false, true, 161) > 0)) {
// line 162
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.', 162, $this->source); })()), "productAPE", [], "any", false, false, true, 162)) {
// line 163
echo " ";
$context["APE"] = (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.', 163, $this->source); })()), "prijs", [], "any", false, false, true, 163) * 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.', 163, $this->source); })()), "AantalPerEenheid", [], "any", false, false, true, 163));
// line 164
echo " ";
$context["APEpromo"] = (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.', 164, $this->source); })()), "promoprijs", [], "any", false, false, true, 164) * 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.', 164, $this->source); })()), "AantalPerEenheid", [], "any", false, false, true, 164));
// line 165
echo "
<span class=\"fs-7 text-decoration-underline\"> ";
// line 166
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("per"), "html", null, true);
echo " € ";
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 166, $this->source); })()), "promoprijs", [], "any", false, false, true, 166), 166, $this->source), 2, ",", " "), "html", null, true);
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($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.', 166, $this->source); })()), "APEeenheid", [], "any", false, false, true, 166), 166, $this->source)), "html", null, true);
echo " </span>
<br>
<strike>€ ";
// line 168
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["APE"]) || array_key_exists("APE", $context) ? $context["APE"] : (function () { throw new RuntimeError('Variable "APE" does not exist.', 168, $this->source); })()), 168, $this->source), 2, ",", " "), "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.', 168, $this->source); })()), "AantalPerEenheid", [], "any", false, false, true, 168), 168, $this->source), "html", null, true);
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($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.', 168, $this->source); })()), "APEeenheid", [], "any", false, false, true, 168), 168, $this->source)), "html", null, true);
echo "</strike><br>
<span class=\"fw-bold fs-4 text-red\">€ ";
// line 169
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["APEpromo"]) || array_key_exists("APEpromo", $context) ? $context["APEpromo"] : (function () { throw new RuntimeError('Variable "APEpromo" does not exist.', 169, $this->source); })()), 169, $this->source), 2, ",", " "), "html", null, true);
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("/"), "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.', 169, $this->source); })()), "AantalPerEenheid", [], "any", false, false, true, 169), 169, $this->source), "html", null, true);
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($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.', 169, $this->source); })()), "APEeenheid", [], "any", false, false, true, 169), 169, $this->source)), "html", null, true);
echo "</span>
";
} else {
// line 171
echo " <strike>€ ";
echo twig_escape_filter($this->env, twig_number_format_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.', 171, $this->source); })()), "prijs", [], "any", false, false, true, 171), 171, $this->source), 2, ",", " "), "html", null, true);
echo "</strike><br>
<span class=\"fw-bold text-red\">€ ";
// line 172
echo twig_escape_filter($this->env, twig_number_format_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.', 172, $this->source); })()), "promoprijs", [], "any", false, false, true, 172), 172, $this->source), 2, ",", " "), "html", null, true);
echo "</span>
";
}
// line 174
echo " ";
} else {
// line 175
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.', 175, $this->source); })()), "productAPE", [], "any", false, false, true, 175)) {
// line 176
echo " <span class=\"fs-7 fw-bold py-5 text-decoration-underline\">
€ ";
// line 177
echo twig_escape_filter($this->env, twig_number_format_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.', 177, $this->source); })()), "prijs", [], "any", false, false, true, 177), 177, $this->source), 2, ",", " "), "html", null, true);
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("per"), "html", null, true);
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($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.', 177, $this->source); })()), "APEeenheid", [], "any", false, false, true, 177), 177, $this->source)), "html", null, true);
echo "
</span>
<br>
<div class=\"mt-3 col-6\">
<label for=\"length\">";
// line 181
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($this->sandbox->ensureToStringAllowed((isset($context["orderByQuantity"]) || array_key_exists("orderByQuantity", $context) ? $context["orderByQuantity"] : (function () { throw new RuntimeError('Variable "orderByQuantity" does not exist.', 181, $this->source); })()), 181, $this->source)), "html", null, true);
echo "</label>
<input class=\"form-control col-3\" type=\"number\" id=\"length\" name=\"length\" step=\"0.1\" required>
</div>
<div class=\"col-6 d-none\">
<label for=\"width\">";
// line 185
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Breedte in m:"), "html", null, true);
echo "</label>
<input class=\"form-control col-3\" type=\"number\" id=\"width\" name=\"width\" step=\"0.1\"
value=\"";
// line 187
echo twig_escape_filter($this->env, twig_number_format_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.', 187, $this->source); })()), "AantalPerEenheid", [], "any", false, false, true, 187), 187, $this->source), 2, ".", " "), "html", null, true);
echo "\" readonly>
</div>
<div class=\"row g-3 align-items-start mt-1\">
<div class=\"col-auto\">
<label for=\"product_amount\" class=\"col-form-label\">";
// line 192
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans((("Aantal " . $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.', 192, $this->source); })()), "APEeenheid", [], "any", false, false, true, 192), 192, $this->source)) . ":")), "html", null, true);
echo "</label>
</div>
<div class=\"col-auto\">
<input type=\"number\" id=\"product_amount\" min=\"1\" max=\"999\" value=\"\" readonly class=\"form-control\"/>
</div>
<div class=\"col-auto pt-1\">
<span class=\"fs-7 fw-bold\" id=\"amount_price\">
€ ";
// line 199
echo twig_escape_filter($this->env, twig_number_format_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.', 199, $this->source); })()), "prijs", [], "any", false, false, true, 199), 199, $this->source), 2, ",", " "), "html", null, true);
echo "
</span>
</div>
<div class=\"col-auto\">
<button id=\"add_to_cart\" class=\"btn btn-secondary\">
<i class=\"fas fa-cart-plus\"></i>
</button>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const lengthInput = document.getElementById('length');
const widthInput = document.getElementById('width');
const totalInput = document.getElementById('product_amount');
const amountPriceSpan = document.getElementById('amount_price');
const pricePerSquareMeter = ";
// line 215
echo twig_escape_filter($this->env, twig_number_format_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.', 215, $this->source); })()), "prijs", [], "any", false, false, true, 215), 215, $this->source), 2, ".", ""), "html", null, true);
echo ";
const updateTotal = () => {
const length = parseFloat(lengthInput.value);
const width = parseFloat(widthInput.value);
if (!isNaN(length) && !isNaN(width)) {
const totalArea = length * width; // Bereken het aantal m²
const roundedArea = Math.ceil(totalArea); // Rond naar boven af
const totalPrice = roundedArea * pricePerSquareMeter; // Bereken de totale prijsvolgens afgerond opp
totalInput.value = roundedArea; // Update aantal m²
amountPriceSpan.textContent = `€ \${totalPrice.toFixed(2).replace('.', ',')}`; // Update de prijs
} else {
totalInput.value = '';
amountPriceSpan.textContent = `€ \${pricePerSquareMeter.toFixed(2).replace('.', ',')}`;
}
};
lengthInput.addEventListener('input', updateTotal);
// Zorg ervoor dat de prijs bij het laden correct wordt weergegeven
updateTotal();
});
</script>
";
} else {
// line 242
echo " <span class=\"fw-bold fs-4\">€ ";
echo twig_escape_filter($this->env, twig_number_format_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.', 242, $this->source); })()), "prijs", [], "any", false, false, true, 242), 242, $this->source), 2, ",", " "), "html", null, true);
echo "</span>
<div class=\"row g-3 align-items-start mt-1\">
<div class=\"col-auto\">
<label for=\"product_amount\" class=\"col-form-label\">";
// line 245
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Aantal:"), "html", null, true);
echo "</label>
</div>
<div class=\"col-auto\">
<input type=\"number\" id=\"product_amount\" min=\"1\" max=\"999\" value=\"1\" class=\"form-control\"/></div>
<div class=\"col-auto\">
<button id=\"add_to_cart\" class=\"btn btn-secondary\"><i class=\"fas fa-cart-plus\"></i></button>
</div>
</div>
";
}
// line 254
echo " ";
}
// line 255
echo " </div>
<input type=\"hidden\" id=\"product_id\" value=\"";
// line 256
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.', 256, $this->source); })()), "id", [], "any", false, false, true, 256), 256, $this->source), "html", null, true);
echo "\">
<span id=\"product_added_confirmation\" class=\"w-100\" style=\"display: none;\"><i class=\"fas fa-check\"></i> ";
// line 257
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Toegevoegd aan winkelwagen."), "html", null, true);
echo "</span>
";
}
// line 259
echo " </div>
</div>
</div>
</div>
</div>
<div class=\"row my-5\">
<div class=\"col-12 text-center\">
";
// line 268
$context["subcategoryLink"] = $this->extensions['App\Twig\Extension\ProductExtension']->generateSubGroupLink($this->sandbox->ensureToStringAllowed((isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 268, $this->source); })()), 268, $this->source), $this->sandbox->ensureToStringAllowed((isset($context["subcategory"]) || array_key_exists("subcategory", $context) ? $context["subcategory"] : (function () { throw new RuntimeError('Variable "subcategory" does not exist.', 268, $this->source); })()), 268, $this->source));
// line 269
echo " <a class=\"btn btn-outline-secondary\" href=\"";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["subcategoryLink"]) || array_key_exists("subcategoryLink", $context) ? $context["subcategoryLink"] : (function () { throw new RuntimeError('Variable "subcategoryLink" does not exist.', 269, $this->source); })()), 269, $this->source), "html", null, true);
echo "\">
<span class=\"material-symbols-outlined inline-icon\">
chevron_left
</span> ";
// line 272
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Terug naar"), "html", null, true);
echo " ";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, (isset($context["subcategory"]) || array_key_exists("subcategory", $context) ? $context["subcategory"] : (function () { throw new RuntimeError('Variable "subcategory" does not exist.', 272, $this->source); })()), "oms", [], "any", false, false, true, 272), 272, $this->source), "html", null, true);
echo "
</a>
</div>
</div>
";
// line 277
if (array_key_exists("shortLink", $context)) {
// line 278
echo " ";
if (((isset($context["shortLink"]) || array_key_exists("shortLink", $context) ? $context["shortLink"] : (function () { throw new RuntimeError('Variable "shortLink" does not exist.', 278, $this->source); })()) == true)) {
// line 279
echo " <script>
\$('#add_to_cart').click((e)=>{
e.preventDefault();
let productId = \$('#product_id').val();
let amount = \$('#product_amount').val();
let fetchUrl = `/\${jsLanguage}/cart/update`;
let productAddedCheckMark = \$('#product_added_confirmation');
productAddedCheckMark.show();
productAddedCheckMark.fadeOut(3000);
\$.ajax({
url: fetchUrl,
cache: false,
type:'GET',
data: {
productId: productId,
amount: amount,
action: 'add'
},
success: (data)=>{
if (data) {
\$('#amount_in_cart').html(data.cartCount);
}
},
error: function (jqXHR, textStatus, errorThrown) {
let errorObj = JSON.parse(jqXHR.responseText);
},
complete: function () {
}
})
})
</script>
";
}
// line 317
echo " ";
}
// line 318
echo "
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
public function getTemplateName()
{
return "product/detail.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 625 => 318, 622 => 317, 582 => 279, 579 => 278, 577 => 277, 567 => 272, 560 => 269, 558 => 268, 547 => 259, 542 => 257, 538 => 256, 535 => 255, 532 => 254, 520 => 245, 513 => 242, 483 => 215, 464 => 199, 454 => 192, 446 => 187, 441 => 185, 434 => 181, 423 => 177, 420 => 176, 417 => 175, 414 => 174, 409 => 172, 404 => 171, 393 => 169, 385 => 168, 376 => 166, 373 => 165, 370 => 164, 367 => 163, 364 => 162, 362 => 161, 359 => 160, 357 => 159, 351 => 155, 342 => 149, 336 => 146, 329 => 142, 323 => 138, 321 => 137, 303 => 121, 292 => 119, 288 => 117, 286 => 116, 276 => 115, 272 => 113, 270 => 112, 266 => 111, 262 => 109, 260 => 108, 257 => 107, 254 => 106, 251 => 105, 248 => 104, 245 => 103, 243 => 102, 240 => 101, 229 => 80, 226 => 79, 218 => 77, 216 => 76, 210 => 75, 206 => 74, 199 => 69, 197 => 68, 195 => 67, 193 => 66, 191 => 65, 189 => 64, 187 => 63, 185 => 62, 183 => 61, 181 => 60, 179 => 59, 177 => 58, 175 => 57, 173 => 56, 171 => 55, 168 => 53, 165 => 52, 159 => 49, 156 => 48, 153 => 47, 151 => 46, 136 => 37, 134 => 36, 130 => 34, 124 => 32, 118 => 30, 116 => 29, 111 => 28, 109 => 27, 100 => 25, 95 => 23, 88 => 18, 78 => 17, 68 => 1, 65 => 14, 63 => 13, 60 => 10, 57 => 7, 54 => 5, 52 => 4, 50 => 3, 37 => 1,);
}
public function getSourceContext()
{
return new Source("{% extends base_layout() %}
{% if category.oms is not empty and subcategory.oms is not empty and product.oms is not empty %}
{% if category.combinedCategoryName is not empty %}
{% set categorieName = category.combinedCategoryName|capitalize %}
{% else %}
{% set categorieName = category.oms|capitalize %}
{% endif %}
{% set head_title = product.oms ~ ' | ' ~ subcategory.oms ~ ' | ' ~ categorieName %}
{% endif %}
{% if product.extrainfo is not empty %}
{% set head_description = product.extrainfo|truncate(200, '...') %}
{% endif %}
{% block content %}
<div class=\"container\">
<div class=\"row\">
<div class=\"col-12 mb-3 pt-5 position-relative\">
<h3 class=\"text-primary\">{{ subcategory.oms|capitalize }}</h3>
<span class=\"position-absolute top-0 pt-3\">
<a href=\"{% if check_websitesetting('product_document', 'document') %}{{ inotherlang('LocalizedDocument', pimcore_website_config('product_document')) }}{% endif %}\">{{ 'Aanbod'|trans }}</a>
/
{% set categoryLink = app_product_grouplink(category) %}
<a href=\"{{ categoryLink }}\">
{% if category.combinedCategoryName is not empty %}
{{ category.combinedCategoryName|capitalize }}
{% else %}
{{ category.oms|capitalize }}
{% endif %}
</a>
/
{% set subcategoryLink = app_product_subgrouplink(category, subcategory) %}
<a href=\"{{ subcategoryLink }}\">{{ subcategory.oms|capitalize }}</a>
/
</span>
</div>
</div>
<div class=\"row justify-content-between\">
{% if product.getFotos() is defined %}
{% if product.getFotos()|length > 0 %}
<div class=\"col-12 col-lg-6 mb-3 mb-lg-0\">
<img src=\"{{ product.getFotos().getThumbnail('prod-thumb') }}\" class=\"img-fluid\">
</div>
{% endif %}
{% endif %}
{# {% if product.getImages()|length > 0 %} #}
{# <div class=\"col-6\"> #}
{# <ul id=\"lightSlider\"> #}
{# {% if product.getImages() is defined %} #}
{# <div class=\"col-md-4 fotoframe\" > #}
{# {% for productImage in product.getImages() %} #}
{# {% if productImage is defined %} #}
{# <li data-thumb=\"{{ productImage.getThumbnail('slideshow-thumb') }}\"><img src=\"{{ productImage.getThumbnail('slideshow-product') }}\" alt=\"{{ product.title }}\" class=\"img-responsive\"></li> #}
{# {% endif %} #}
{# {% endfor %} #}
{# </div> #}
{# {% endif %} #}
{# </ul> #}
{# </div> #}
{# {% endif %} #}
<div class=\"col-12 col-lg-6 ps-lg-5\">
<div class=\"row mb-3\">
<div class=\"col-12\">
<h2 class=\"text-primary\">{{ product.oms }}</h2>
<i class=\"text-black text-opacity-50\">{{ 'Code:'|trans }} {{ product.code }}</i><br>
{% if product.merk is not empty %}
<span>{{ 'Merk:'|trans }} {{ product.merk }}</span><br>
{% endif %}
<div class=\"mt-3\">
{{ product.extrainfo|raw }}</div>
</div>
</div>
<div class=\"row mb-5\">
<div class=\"col-12\">
{# {% if product.stock <= 0 %}
<p><span class=\"stockrood me-1\">
<i class=\"fas fa-xs fa-circle\"></i>
</span>{{ 'momenteel niet voorradig'|trans|raw }}</p>
{% elseif product.stock <= product.aantalVerkochtLaatsteMaand %}
<span class=\"stockoranje ms-1\">
<i class=\"fas fa-xs fa-circle\"></i>
{{ 'beperkte voorraad'|trans|raw }}</span>
{% elseif product.stock > product.aantalVerkochtLaatsteMaand %}
<span class=\"stockgroen ms-1\">
<i class=\"fas fa-xs fa-circle\"></i>
{{ 'voldoende vooraad'|trans|raw }}</span>
{% endif %}#}
{% if product.productAPE %}
{% set productUnit = product.APEeenheid %}
{% else %}
{% set productUnit = 'stuk(s)' %}
{% endif %}
{% if product.stock <= 0 %}
<p><span class=\"stockrood me-1\">
<i class=\"fas fa-xs fa-circle\"></i>
</span>{{ 'momenteel niet voorradig *'|trans|raw }}</p>
{% elseif product.stock <= product.aantalVerkochtLaatsteMaand %}
<span class=\"stockoranje ms-1\">
<i class=\"fas fa-xs fa-circle\"></i>
{{ 'Beperkt op voorraad, er zijn momenteel '|trans|raw }} {{ product.stock }} {{ productUnit |trans|raw }} {{' in voorraad. *'|trans|raw }}</span>
{% elseif product.stock > product.aantalVerkochtLaatsteMaand %}
<span class=\"stockgroen ms-1\">
<i class=\"fas fa-xs fa-circle\"></i>
{{ 'Voldoende voorraad, er zijn momenteel '|trans|raw }} {{ product.stock }} {{ productUnit |trans|raw }} {{' in voorraad. *'|trans|raw }}</span>
{% endif %}
</div>
</div>
<script>
\$(document).ready(function(){
\$(\"#myModal\").modal('show');
});
</script>
{% if product.stock <= 0 %}
<div id=\"myModal\" class=\"modal fade\" tabindex=\"-1\">
<div class=\"modal-dialog\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h5 class=\"modal-title\">{{ 'Momenteel niet op voorraad'|trans }}</h5>
<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>
</div>
<div class=\"modal-body\">
<p>{{ 'Opgepast, dit product is momenteel niet op voorraad en levering kan langer duren dan gebruikelijk.'|trans }}</p>
</div>
<div class=\"modal-footer\">
<button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">{{ 'Oke'|trans }}</button>
</div>
</div>
</div>
</div>
{% endif %}
<div class=\"row\">
<div class=\"col-12\">
{% if product.promoprijs is defined %}
<div class=\"p-3 bg-light-grey bg-opacity-50 w-75 mb-3\">
{% if product.promoprijs > 0 %}
{% if product.productAPE %}
{% set APE = product.prijs * product.AantalPerEenheid %}
{% set APEpromo = product.promoprijs * product.AantalPerEenheid %}
<span class=\"fs-7 text-decoration-underline\"> {{ 'per'|trans }} € {{ product.promoprijs|number_format(2, ',', ' ') }} {{ product.APEeenheid | trans}} </span>
<br>
<strike>€ {{ APE|number_format(2, ',', ' ') }} | {{ product.AantalPerEenheid }} {{ product.APEeenheid | trans}}</strike><br>
<span class=\"fw-bold fs-4 text-red\">€ {{ APEpromo|number_format(2, ',', ' ') }} {{ '/'|trans }} {{ product.AantalPerEenheid }} {{ product.APEeenheid | trans}}</span>
{% else %}
<strike>€ {{ product.prijs|number_format(2, ',', ' ') }}</strike><br>
<span class=\"fw-bold text-red\">€ {{ product.promoprijs|number_format(2, ',', ' ') }}</span>
{% endif %}
{% else %}
{% if product.productAPE %}
<span class=\"fs-7 fw-bold py-5 text-decoration-underline\">
€ {{ product.prijs|number_format(2, ',', ' ') }} {{ 'per'|trans }} {{ product.APEeenheid | trans }}
</span>
<br>
<div class=\"mt-3 col-6\">
<label for=\"length\">{{ orderByQuantity |trans }}</label>
<input class=\"form-control col-3\" type=\"number\" id=\"length\" name=\"length\" step=\"0.1\" required>
</div>
<div class=\"col-6 d-none\">
<label for=\"width\">{{ 'Breedte in m:'|trans }}</label>
<input class=\"form-control col-3\" type=\"number\" id=\"width\" name=\"width\" step=\"0.1\"
value=\"{{ product.AantalPerEenheid|number_format(2, '.', ' ') }}\" readonly>
</div>
<div class=\"row g-3 align-items-start mt-1\">
<div class=\"col-auto\">
<label for=\"product_amount\" class=\"col-form-label\">{{ ('Aantal ' ~ product.APEeenheid ~ ':') |trans }}</label>
</div>
<div class=\"col-auto\">
<input type=\"number\" id=\"product_amount\" min=\"1\" max=\"999\" value=\"\" readonly class=\"form-control\"/>
</div>
<div class=\"col-auto pt-1\">
<span class=\"fs-7 fw-bold\" id=\"amount_price\">
€ {{ product.prijs|number_format(2, ',', ' ') }}
</span>
</div>
<div class=\"col-auto\">
<button id=\"add_to_cart\" class=\"btn btn-secondary\">
<i class=\"fas fa-cart-plus\"></i>
</button>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const lengthInput = document.getElementById('length');
const widthInput = document.getElementById('width');
const totalInput = document.getElementById('product_amount');
const amountPriceSpan = document.getElementById('amount_price');
const pricePerSquareMeter = {{ product.prijs|number_format(2, '.', '') }};
const updateTotal = () => {
const length = parseFloat(lengthInput.value);
const width = parseFloat(widthInput.value);
if (!isNaN(length) && !isNaN(width)) {
const totalArea = length * width; // Bereken het aantal m²
const roundedArea = Math.ceil(totalArea); // Rond naar boven af
const totalPrice = roundedArea * pricePerSquareMeter; // Bereken de totale prijsvolgens afgerond opp
totalInput.value = roundedArea; // Update aantal m²
amountPriceSpan.textContent = `€ \${totalPrice.toFixed(2).replace('.', ',')}`; // Update de prijs
} else {
totalInput.value = '';
amountPriceSpan.textContent = `€ \${pricePerSquareMeter.toFixed(2).replace('.', ',')}`;
}
};
lengthInput.addEventListener('input', updateTotal);
// Zorg ervoor dat de prijs bij het laden correct wordt weergegeven
updateTotal();
});
</script>
{% else %}
<span class=\"fw-bold fs-4\">€ {{ product.prijs|number_format(2, ',', ' ') }}</span>
<div class=\"row g-3 align-items-start mt-1\">
<div class=\"col-auto\">
<label for=\"product_amount\" class=\"col-form-label\">{{ 'Aantal:'|trans }}</label>
</div>
<div class=\"col-auto\">
<input type=\"number\" id=\"product_amount\" min=\"1\" max=\"999\" value=\"1\" class=\"form-control\"/></div>
<div class=\"col-auto\">
<button id=\"add_to_cart\" class=\"btn btn-secondary\"><i class=\"fas fa-cart-plus\"></i></button>
</div>
</div>
{% endif %}
{% endif %}
</div>
<input type=\"hidden\" id=\"product_id\" value=\"{{ product.id }}\">
<span id=\"product_added_confirmation\" class=\"w-100\" style=\"display: none;\"><i class=\"fas fa-check\"></i> {{ \"Toegevoegd aan winkelwagen.\" | trans }}</span>
{% endif %}
</div>
</div>
</div>
</div>
</div>
<div class=\"row my-5\">
<div class=\"col-12 text-center\">
{% set subcategoryLink = app_product_subgrouplink(category, subcategory) %}
<a class=\"btn btn-outline-secondary\" href=\"{{ subcategoryLink }}\">
<span class=\"material-symbols-outlined inline-icon\">
chevron_left
</span> {{ 'Terug naar'|trans }} {{ subcategory.oms }}
</a>
</div>
</div>
{% if shortLink is defined %}
{% if shortLink == true %}
<script>
\$('#add_to_cart').click((e)=>{
e.preventDefault();
let productId = \$('#product_id').val();
let amount = \$('#product_amount').val();
let fetchUrl = `/\${jsLanguage}/cart/update`;
let productAddedCheckMark = \$('#product_added_confirmation');
productAddedCheckMark.show();
productAddedCheckMark.fadeOut(3000);
\$.ajax({
url: fetchUrl,
cache: false,
type:'GET',
data: {
productId: productId,
amount: amount,
action: 'add'
},
success: (data)=>{
if (data) {
\$('#amount_in_cart').html(data.cartCount);
}
},
error: function (jqXHR, textStatus, errorThrown) {
let errorObj = JSON.parse(jqXHR.responseText);
},
complete: function () {
}
})
})
</script>
{% endif %}
{% endif %}
{% endblock %}", "product/detail.html.twig", "/var/www/clients/client2/web42/web/pc/templates/product/detail.html.twig");
}
public function checkSecurity()
{
static $tags = array("if" => 3, "set" => 5);
static $filters = array("capitalize" => 5, "truncate" => 14, "escape" => 23, "trans" => 25, "length" => 47, "raw" => 80, "number_format" => 166);
static $functions = array("check_websitesetting" => 25, "inotherlang" => 25, "pimcore_website_config" => 25, "app_product_grouplink" => 27, "app_product_subgrouplink" => 36, "base_layout" => 1);
try {
$this->sandbox->checkSecurity(
['if', 'set'],
['capitalize', 'truncate', 'escape', 'trans', 'length', 'raw', 'number_format'],
['check_websitesetting', 'inotherlang', 'pimcore_website_config', 'app_product_grouplink', 'app_product_subgrouplink', 'base_layout']
);
} 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;
}
}
}