var/cache/dev/twig/5c/5ccbe964b4438ae9f25f5c789a2b89cf9b275d0d53ebbcd9e143ede3ed888262.php line 223

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* @SyliusShop/Product/Show/_productaction.html.twig */
  14. class __TwigTemplate_d8ae42ccb8429a710732b63b34134b5e1a514d43c4c256777b042d688bb99fde extends \Twig\Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->parent false;
  23.         $this->blocks = [
  24.         ];
  25.     }
  26.     protected function doDisplay(array $context, array $blocks = [])
  27.     {
  28.         $macros $this->macros;
  29.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  30.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@SyliusShop/Product/Show/_productaction.html.twig"));
  31.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  32.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@SyliusShop/Product/Show/_productaction.html.twig"));
  33.         // line 1
  34.         echo "        <div class=\"price product-details__actions\">
  35.             <div class=\"product-details__price-block\">
  36.                 <div class=\"\">
  37.                 <!-- ICI BLOC CODE POUR AFFICHER LE PRIX - GESTION PRIX PROMO + PRIX VARIANT -->
  38.                     ";
  39.         // line 7
  40.         if ( !twig_get_attribute($this->env$this->sourcetwig_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.'7$this->source); })()), "enabledVariants", [], "any"falsefalsefalse7), "empty", [], "method"falsefalsefalse7)) {
  41.             // line 8
  42.             echo "                        ";
  43.             $macros["money"] = $this->macros["money"] = $this->loadTemplate("@SyliusShop/Common/Macro/money.html.twig""@SyliusShop/Product/Show/_productaction.html.twig"8)->unwrap();
  44.             // line 9
  45.             echo "                        ";
  46.             $context["variant"] = $this->env->getFilter('sylius_resolve_variant')->getCallable()((isset($context["product"]) || array_key_exists("product"$context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.'9$this->source); })()));
  47.             // line 10
  48.             echo "                        ";
  49.             $context["hasDiscount"] = $this->env->getFilter('sylius_has_discount')->getCallable()((isset($context["variant"]) || array_key_exists("variant"$context) ? $context["variant"] : (function () { throw new RuntimeError('Variable "variant" does not exist.'10$this->source); })()), ["channel" => twig_get_attribute($this->env$this->source, (isset($context["sylius"]) || array_key_exists("sylius"$context) ? $context["sylius"] : (function () { throw new RuntimeError('Variable "sylius" does not exist.'10$this->source); })()), "channel", [], "any"falsefalsefalse10)]);
  50.             // line 11
  51.             echo "                        <span class=\"product-details__prices product-details__prices--old\" id=\"product-original-price\" ";
  52.             echo $this->env->getFunction('sylius_test_html_attribute')->getCallable()("product-original-price"twig_call_macro($macros["money"], "macro_calculateOriginalPrice", [(isset($context["variant"]) || array_key_exists("variant"$context) ? $context["variant"] : (function () { throw new RuntimeError('Variable "variant" does not exist.'11$this->source); })())], 11$context$this->getSourceContext()));
  53.             echo ">
  54.                             ";
  55.             // line 12
  56.             if ((isset($context["hasDiscount"]) || array_key_exists("hasDiscount"$context) ? $context["hasDiscount"] : (function () { throw new RuntimeError('Variable "hasDiscount" does not exist.'12$this->source); })())) {
  57.                 // line 13
  58.                 echo "                                <del>";
  59.                 echo twig_call_macro($macros["money"], "macro_calculateOriginalPrice", [(isset($context["variant"]) || array_key_exists("variant"$context) ? $context["variant"] : (function () { throw new RuntimeError('Variable "variant" does not exist.'13$this->source); })())], 13$context$this->getSourceContext());
  60.                 echo "</del>
  61.                             ";
  62.             }
  63.             // line 15
  64.             echo "                        </span>
  65.                         <span class=\"product-details__prices\" id=\"product-price\" ";
  66.             // line 16
  67.             echo $this->env->getFunction('sylius_test_html_attribute')->getCallable()("product-price"twig_call_macro($macros["money"], "macro_calculatePrice", [(isset($context["variant"]) || array_key_exists("variant"$context) ? $context["variant"] : (function () { throw new RuntimeError('Variable "variant" does not exist.'16$this->source); })())], 16$context$this->getSourceContext()));
  68.             echo ">
  69.                             ";
  70.             // line 17
  71.             echo twig_call_macro($macros["money"], "macro_calculatePrice", [(isset($context["variant"]) || array_key_exists("variant"$context) ? $context["variant"] : (function () { throw new RuntimeError('Variable "variant" does not exist.'17$this->source); })())], 17$context$this->getSourceContext());
  72.             echo "
  73.                         </span>
  74.                     ";
  75.         }
  76.         // line 21
  77.         echo "                    ";
  78.         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.'21$this->source); })()), "isConfigurable", [], "method"falsefalsefalse21) && (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.'21$this->source); })()), "getVariantSelectionMethod", [], "method"falsefalsefalse21) == "match")) &&  !twig_get_attribute($this->env$this->sourcetwig_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.'21$this->source); })()), "enabledVariants", [], "any"falsefalsefalse21), "empty", [], "method"falsefalsefalse21))) {
  79.             // line 22
  80.             echo "                        ";
  81.             $context["pricing"] = $this->env->getFunction('sylius_product_variant_prices')->getCallable()((isset($context["product"]) || array_key_exists("product"$context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.'22$this->source); })()), twig_get_attribute($this->env$this->source, (isset($context["sylius"]) || array_key_exists("sylius"$context) ? $context["sylius"] : (function () { throw new RuntimeError('Variable "sylius" does not exist.'22$this->source); })()), "channel", [], "any"falsefalsefalse22));
  82.             // line 23
  83.             echo "                        ";
  84.             $macros["money"] = $this->macros["money"] = $this->loadTemplate("@SyliusShop/Common/Macro/money.html.twig""@SyliusShop/Product/Show/_productaction.html.twig"23)->unwrap();
  85.             // line 24
  86.             echo "
  87.                         <div id=\"sylius-variants-pricing\" data-unavailable-text=\"";
  88.             // line 25
  89.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("sylius.ui.unavailable"), "html"nulltrue);
  90.             echo "\">
  91.                             ";
  92.             // line 26
  93.             $context['_parent'] = $context;
  94.             $context['_seq'] = twig_ensure_traversable((isset($context["pricing"]) || array_key_exists("pricing"$context) ? $context["pricing"] : (function () { throw new RuntimeError('Variable "pricing" does not exist.'26$this->source); })()));
  95.             foreach ($context['_seq'] as $context["_key"] => $context["price"]) {
  96.                 // line 27
  97.                 echo "                                <div ";
  98.                 $context['_parent'] = $context;
  99.                 $context['_seq'] = twig_ensure_traversable($context["price"]);
  100.                 foreach ($context['_seq'] as $context["option"] => $context["value"]) {
  101.                     echo "data-";
  102.                     echo twig_escape_filter($this->env$context["option"], "html"nulltrue);
  103.                     echo "=\"";
  104.                     if ((($context["option"] == "value") || ($context["option"] == "original-price"))) {
  105.                         echo twig_call_macro($macros["money"], "macro_convertAndFormat", [$context["value"]], 27$context$this->getSourceContext());
  106.                     } else {
  107.                         echo twig_escape_filter($this->envtwig_replace_filter($context["value"], ["\"" => "'"]), "html"nulltrue);
  108.                     }
  109.                     echo "\" ";
  110.                     echo $this->env->getFunction('sylius_test_html_attribute')->getCallable()("variant-price");
  111.                 }
  112.                 $_parent $context['_parent'];
  113.                 unset($context['_seq'], $context['_iterated'], $context['option'], $context['value'], $context['_parent'], $context['loop']);
  114.                 $context array_intersect_key($context$_parent) + $_parent;
  115.                 echo "></div>
  116.                             ";
  117.             }
  118.             $_parent $context['_parent'];
  119.             unset($context['_seq'], $context['_iterated'], $context['_key'], $context['price'], $context['_parent'], $context['loop']);
  120.             $context array_intersect_key($context$_parent) + $_parent;
  121.             // line 29
  122.             echo "                        </div>
  123.                     ";
  124.         }
  125.         // line 31
  126.         echo "
  127.  
  128.        
  129.                 <!-- FIN CODE PRIX -->
  130.                 </div>
  131.                 <div class=\"product-details__stock-block\">
  132.                     <!-- STOCK -->
  133.                      ";
  134.         // line 47
  135.         $context["instock"] = true;
  136.         // line 48
  137.         echo "                    ";
  138.         if ((twig_get_attribute($this->env$this->sourcetwig_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.'48$this->source); })()), "enabledVariants", [], "any"falsefalsefalse48), "empty", [], "method"falsefalsefalse48) || (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.'48$this->source); })()), "simple", [], "any"falsefalsefalse48) &&  !$this->env->getFunction('sylius_inventory_is_available')->getCallable()(twig_get_attribute($this->env$this->sourcetwig_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.'48$this->source); })()), "enabledVariants", [], "any"falsefalsefalse48), "first", [], "any"falsefalsefalse48))))) {
  139.             // line 49
  140.             echo "                        ";
  141.             $context["instock"] = false;
  142.             // line 50
  143.             echo "                        <div class=\"ui small negative icon message\" id=\"sylius-product-out-of-stock\"  ";
  144.             echo $this->env->getFunction('sylius_test_html_attribute')->getCallable()("product-out-of-stock");
  145.             echo ">
  146.                             <div class=\"product-details__stock product-details__stock--out\">
  147.                                 <i class=\"fas fa-times\"></i> ";
  148.             // line 52
  149.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("sylius.ui.out_of_stock"), "html"nulltrue);
  150.             echo "
  151.                             </div>
  152.                         </div>
  153.                     ";
  154.         } elseif ((        // line 55
  155. (isset($context["mode"]) || array_key_exists("mode"$context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.'55$this->source); })()) != "gift")) {
  156.             // line 56
  157.             echo "                        ";
  158.             $context["instock"] = true;
  159.             // line 57
  160.             echo "                        <div class=\"product-details__stock product-details__stock--in\">
  161.                             <i class=\"fas fa-check\"></i>";
  162.             // line 58
  163.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("sylius.ui.enstock"), "html"nulltrue);
  164.             echo "
  165.                         </div>
  166.                      ";
  167.         }
  168.         // line 61
  169.         echo "
  170.                 </div>
  171.             </div>
  172.                     ";
  173.         // line 67
  174.         if (twig_get_attribute($this->env$this->source, ($context["SimpleAttributes"] ?? null), "prixkg", [], "any"truetruefalse67)) {
  175.             // line 68
  176.             echo "                        ";
  177.             $context["prixkg"] = twig_get_attribute($this->env$this->source, (isset($context["SimpleAttributes"]) || array_key_exists("SimpleAttributes"$context) ? $context["SimpleAttributes"] : (function () { throw new RuntimeError('Variable "SimpleAttributes" does not exist.'68$this->source); })()), "prixkg", [], "any"falsefalsefalse68);
  178.             // line 69
  179.             echo "                        ";
  180.             if (( !(null === (isset($context["prixkg"]) || array_key_exists("prixkg"$context) ? $context["prixkg"] : (function () { throw new RuntimeError('Variable "prixkg" does not exist.'69$this->source); })())) &&  !twig_test_empty((isset($context["prixkg"]) || array_key_exists("prixkg"$context) ? $context["prixkg"] : (function () { throw new RuntimeError('Variable "prixkg" does not exist.'69$this->source); })())))) {
  181.                 // line 70
  182.                 echo "                            <div class=\"prixkg\"><em>";
  183.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source, (isset($context["prixkg"]) || array_key_exists("prixkg"$context) ? $context["prixkg"] : (function () { throw new RuntimeError('Variable "prixkg" does not exist.'70$this->source); })()), "value", [], "any"falsefalsefalse70), "html"nulltrue);
  184.                 echo " € / kg</em></div>
  185.                         ";
  186.             }
  187.             // line 72
  188.             echo "                    ";
  189.         }
  190.         // line 73
  191.         echo "
  192.             ";
  193.         // line 74
  194.         if ((isset($context["instock"]) || array_key_exists("instock"$context) ? $context["instock"] : (function () { throw new RuntimeError('Variable "instock" does not exist.'74$this->source); })())) {
  195.             // line 75
  196.             echo "                <div class=\"product-details__form\">
  197.                     ";
  198.             // line 76
  199.             echo $this->env->getRuntime('Symfony\Bridge\Twig\Extension\HttpKernelRuntime')->renderFragment($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("sylius_shop_partial_cart_add_item", ["template" => "@SyliusShop/Product/Show/_addToCart.html.twig""productId" => 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); })()), "id", [], "any"falsefalsefalse76)]));
  200.             echo "
  201.                 </div>
  202.             ";
  203.         }
  204.         // line 79
  205.         echo "
  206.         </div>
  207. ";
  208.         
  209.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  210.         
  211.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  212.     }
  213.     public function getTemplateName()
  214.     {
  215.         return "@SyliusShop/Product/Show/_productaction.html.twig";
  216.     }
  217.     public function isTraitable()
  218.     {
  219.         return false;
  220.     }
  221.     public function getDebugInfo()
  222.     {
  223.         return array (  229 => 79,  223 => 76,  220 => 75,  218 => 74,  215 => 73,  212 => 72,  206 => 70,  203 => 69,  200 => 68,  198 => 67,  190 => 61,  184 => 58,  181 => 57,  178 => 56,  176 => 55,  170 => 52,  164 => 50,  161 => 49,  158 => 48,  156 => 47,  138 => 31,  134 => 29,  109 => 27,  105 => 26,  101 => 25,  98 => 24,  95 => 23,  92 => 22,  89 => 21,  82 => 17,  78 => 16,  75 => 15,  69 => 13,  67 => 12,  62 => 11,  59 => 10,  56 => 9,  53 => 8,  51 => 7,  43 => 1,);
  224.     }
  225.     public function getSourceContext()
  226.     {
  227.         return new Source("        <div class=\"price product-details__actions\">
  228.             <div class=\"product-details__price-block\">
  229.                 <div class=\"\">
  230.                 <!-- ICI BLOC CODE POUR AFFICHER LE PRIX - GESTION PRIX PROMO + PRIX VARIANT -->
  231.                     {% if not product.enabledVariants.empty() %}
  232.                         {% import \"@SyliusShop/Common/Macro/money.html.twig\" as money %}
  233.                         {% set variant = product|sylius_resolve_variant %}
  234.                         {% set hasDiscount = variant|sylius_has_discount({'channel': sylius.channel}) %}
  235.                         <span class=\"product-details__prices product-details__prices--old\" id=\"product-original-price\" {{ sylius_test_html_attribute('product-original-price', money.calculateOriginalPrice(variant)) }}>
  236.                             {% if hasDiscount %}
  237.                                 <del>{{ money.calculateOriginalPrice(variant) }}</del>
  238.                             {% endif %}
  239.                         </span>
  240.                         <span class=\"product-details__prices\" id=\"product-price\" {{ sylius_test_html_attribute('product-price', money.calculatePrice(variant)) }}>
  241.                             {{ money.calculatePrice(variant) }}
  242.                         </span>
  243.                     {% endif %}
  244.                     {% if product.isConfigurable() and product.getVariantSelectionMethod() == 'match' and not product.enabledVariants.empty() %}
  245.                         {% set pricing = sylius_product_variant_prices(product, sylius.channel) %}
  246.                         {% import \"@SyliusShop/Common/Macro/money.html.twig\" as money %}
  247.                         <div id=\"sylius-variants-pricing\" data-unavailable-text=\"{{ 'sylius.ui.unavailable'|trans }}\">
  248.                             {% for price in pricing %}
  249.                                 <div {% for option, value in price %}data-{{ option }}=\"{% if option == 'value' or option == 'original-price' %}{{ money.convertAndFormat(value) }}{% else %}{{ value|replace({'\\\"': '\\''}) }}{% endif %}\" {{ sylius_test_html_attribute('variant-price') }}{% endfor %}></div>
  250.                             {% endfor %}
  251.                         </div>
  252.                     {% endif %}
  253.  
  254.        
  255.                 <!-- FIN CODE PRIX -->
  256.                 </div>
  257.                 <div class=\"product-details__stock-block\">
  258.                     <!-- STOCK -->
  259.                      {% set instock = true %}
  260.                     {% if product.enabledVariants.empty() or product.simple and not sylius_inventory_is_available(product.enabledVariants.first) %}
  261.                         {% set instock = false %}
  262.                         <div class=\"ui small negative icon message\" id=\"sylius-product-out-of-stock\"  {{ sylius_test_html_attribute('product-out-of-stock') }}>
  263.                             <div class=\"product-details__stock product-details__stock--out\">
  264.                                 <i class=\"fas fa-times\"></i> {{ 'sylius.ui.out_of_stock'|trans }}
  265.                             </div>
  266.                         </div>
  267.                     {% elseif mode != \"gift\"  %}
  268.                         {% set instock = true %}
  269.                         <div class=\"product-details__stock product-details__stock--in\">
  270.                             <i class=\"fas fa-check\"></i>{{ 'sylius.ui.enstock'|trans }}
  271.                         </div>
  272.                      {% endif %}
  273.                 </div>
  274.             </div>
  275.                     {% if SimpleAttributes.prixkg is defined %}
  276.                         {% set prixkg = SimpleAttributes.prixkg %}
  277.                         {% if prixkg is not null and prixkg is not empty %}
  278.                             <div class=\"prixkg\"><em>{{ prixkg.value }} € / kg</em></div>
  279.                         {% endif %}
  280.                     {% endif %}
  281.             {% if instock %}
  282.                 <div class=\"product-details__form\">
  283.                     {{ render(url('sylius_shop_partial_cart_add_item', {'template': '@SyliusShop/Product/Show/_addToCart.html.twig', 'productId': product.id})) }}
  284.                 </div>
  285.             {% endif %}
  286.         </div>
  287. ""@SyliusShop/Product/Show/_productaction.html.twig""/home/mons/site/www/templates/bundles/SyliusShopBundle/Product/Show/_productaction.html.twig");
  288.     }
  289. }