<?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;
/* @SyliusShop/Product/Show/_productaction.html.twig */
class __TwigTemplate_d8ae42ccb8429a710732b63b34134b5e1a514d43c4c256777b042d688bb99fde extends \Twig\Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
}
protected function doDisplay(array $context, array $blocks = [])
{
$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", "@SyliusShop/Product/Show/_productaction.html.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@SyliusShop/Product/Show/_productaction.html.twig"));
// line 1
echo " <div class=\"price product-details__actions\">
<div class=\"product-details__price-block\">
<div class=\"\">
<!-- ICI BLOC CODE POUR AFFICHER LE PRIX - GESTION PRIX PROMO + PRIX VARIANT -->
";
// line 7
if ( !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.', 7, $this->source); })()), "enabledVariants", [], "any", false, false, false, 7), "empty", [], "method", false, false, false, 7)) {
// line 8
echo " ";
$macros["money"] = $this->macros["money"] = $this->loadTemplate("@SyliusShop/Common/Macro/money.html.twig", "@SyliusShop/Product/Show/_productaction.html.twig", 8)->unwrap();
// line 9
echo " ";
$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); })()));
// line 10
echo " ";
$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", false, false, false, 10)]);
// line 11
echo " <span class=\"product-details__prices product-details__prices--old\" id=\"product-original-price\" ";
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()));
echo ">
";
// line 12
if ((isset($context["hasDiscount"]) || array_key_exists("hasDiscount", $context) ? $context["hasDiscount"] : (function () { throw new RuntimeError('Variable "hasDiscount" does not exist.', 12, $this->source); })())) {
// line 13
echo " <del>";
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());
echo "</del>
";
}
// line 15
echo " </span>
<span class=\"product-details__prices\" id=\"product-price\" ";
// line 16
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()));
echo ">
";
// line 17
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());
echo "
</span>
";
}
// line 21
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.', 21, $this->source); })()), "isConfigurable", [], "method", false, false, false, 21) && (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", false, false, false, 21) == "match")) && !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.', 21, $this->source); })()), "enabledVariants", [], "any", false, false, false, 21), "empty", [], "method", false, false, false, 21))) {
// line 22
echo " ";
$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", false, false, false, 22));
// line 23
echo " ";
$macros["money"] = $this->macros["money"] = $this->loadTemplate("@SyliusShop/Common/Macro/money.html.twig", "@SyliusShop/Product/Show/_productaction.html.twig", 23)->unwrap();
// line 24
echo "
<div id=\"sylius-variants-pricing\" data-unavailable-text=\"";
// line 25
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("sylius.ui.unavailable"), "html", null, true);
echo "\">
";
// line 26
$context['_parent'] = $context;
$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); })()));
foreach ($context['_seq'] as $context["_key"] => $context["price"]) {
// line 27
echo " <div ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable($context["price"]);
foreach ($context['_seq'] as $context["option"] => $context["value"]) {
echo "data-";
echo twig_escape_filter($this->env, $context["option"], "html", null, true);
echo "=\"";
if ((($context["option"] == "value") || ($context["option"] == "original-price"))) {
echo twig_call_macro($macros["money"], "macro_convertAndFormat", [$context["value"]], 27, $context, $this->getSourceContext());
} else {
echo twig_escape_filter($this->env, twig_replace_filter($context["value"], ["\"" => "'"]), "html", null, true);
}
echo "\" ";
echo $this->env->getFunction('sylius_test_html_attribute')->getCallable()("variant-price");
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['option'], $context['value'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
echo "></div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['price'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 29
echo " </div>
";
}
// line 31
echo "
<!-- FIN CODE PRIX -->
</div>
<div class=\"product-details__stock-block\">
<!-- STOCK -->
";
// line 47
$context["instock"] = true;
// line 48
echo " ";
if ((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.', 48, $this->source); })()), "enabledVariants", [], "any", false, false, false, 48), "empty", [], "method", false, false, false, 48) || (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", false, false, false, 48) && !$this->env->getFunction('sylius_inventory_is_available')->getCallable()(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.', 48, $this->source); })()), "enabledVariants", [], "any", false, false, false, 48), "first", [], "any", false, false, false, 48))))) {
// line 49
echo " ";
$context["instock"] = false;
// line 50
echo " <div class=\"ui small negative icon message\" id=\"sylius-product-out-of-stock\" ";
echo $this->env->getFunction('sylius_test_html_attribute')->getCallable()("product-out-of-stock");
echo ">
<div class=\"product-details__stock product-details__stock--out\">
<i class=\"fas fa-times\"></i> ";
// line 52
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("sylius.ui.out_of_stock"), "html", null, true);
echo "
</div>
</div>
";
} elseif (( // line 55
(isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 55, $this->source); })()) != "gift")) {
// line 56
echo " ";
$context["instock"] = true;
// line 57
echo " <div class=\"product-details__stock product-details__stock--in\">
<i class=\"fas fa-check\"></i>";
// line 58
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("sylius.ui.enstock"), "html", null, true);
echo "
</div>
";
}
// line 61
echo "
</div>
</div>
";
// line 67
if (twig_get_attribute($this->env, $this->source, ($context["SimpleAttributes"] ?? null), "prixkg", [], "any", true, true, false, 67)) {
// line 68
echo " ";
$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", false, false, false, 68);
// line 69
echo " ";
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); })())))) {
// line 70
echo " <div class=\"prixkg\"><em>";
echo twig_escape_filter($this->env, twig_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", false, false, false, 70), "html", null, true);
echo " € / kg</em></div>
";
}
// line 72
echo " ";
}
// line 73
echo "
";
// line 74
if ((isset($context["instock"]) || array_key_exists("instock", $context) ? $context["instock"] : (function () { throw new RuntimeError('Variable "instock" does not exist.', 74, $this->source); })())) {
// line 75
echo " <div class=\"product-details__form\">
";
// line 76
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", false, false, false, 76)]));
echo "
</div>
";
}
// line 79
echo "
</div>
";
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
public function getTemplateName()
{
return "@SyliusShop/Product/Show/_productaction.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
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,);
}
public function getSourceContext()
{
return new Source(" <div class=\"price product-details__actions\">
<div class=\"product-details__price-block\">
<div class=\"\">
<!-- ICI BLOC CODE POUR AFFICHER LE PRIX - GESTION PRIX PROMO + PRIX VARIANT -->
{% if not product.enabledVariants.empty() %}
{% import \"@SyliusShop/Common/Macro/money.html.twig\" as money %}
{% set variant = product|sylius_resolve_variant %}
{% set hasDiscount = variant|sylius_has_discount({'channel': sylius.channel}) %}
<span class=\"product-details__prices product-details__prices--old\" id=\"product-original-price\" {{ sylius_test_html_attribute('product-original-price', money.calculateOriginalPrice(variant)) }}>
{% if hasDiscount %}
<del>{{ money.calculateOriginalPrice(variant) }}</del>
{% endif %}
</span>
<span class=\"product-details__prices\" id=\"product-price\" {{ sylius_test_html_attribute('product-price', money.calculatePrice(variant)) }}>
{{ money.calculatePrice(variant) }}
</span>
{% endif %}
{% if product.isConfigurable() and product.getVariantSelectionMethod() == 'match' and not product.enabledVariants.empty() %}
{% set pricing = sylius_product_variant_prices(product, sylius.channel) %}
{% import \"@SyliusShop/Common/Macro/money.html.twig\" as money %}
<div id=\"sylius-variants-pricing\" data-unavailable-text=\"{{ 'sylius.ui.unavailable'|trans }}\">
{% for price in pricing %}
<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>
{% endfor %}
</div>
{% endif %}
<!-- FIN CODE PRIX -->
</div>
<div class=\"product-details__stock-block\">
<!-- STOCK -->
{% set instock = true %}
{% if product.enabledVariants.empty() or product.simple and not sylius_inventory_is_available(product.enabledVariants.first) %}
{% set instock = false %}
<div class=\"ui small negative icon message\" id=\"sylius-product-out-of-stock\" {{ sylius_test_html_attribute('product-out-of-stock') }}>
<div class=\"product-details__stock product-details__stock--out\">
<i class=\"fas fa-times\"></i> {{ 'sylius.ui.out_of_stock'|trans }}
</div>
</div>
{% elseif mode != \"gift\" %}
{% set instock = true %}
<div class=\"product-details__stock product-details__stock--in\">
<i class=\"fas fa-check\"></i>{{ 'sylius.ui.enstock'|trans }}
</div>
{% endif %}
</div>
</div>
{% if SimpleAttributes.prixkg is defined %}
{% set prixkg = SimpleAttributes.prixkg %}
{% if prixkg is not null and prixkg is not empty %}
<div class=\"prixkg\"><em>{{ prixkg.value }} € / kg</em></div>
{% endif %}
{% endif %}
{% if instock %}
<div class=\"product-details__form\">
{{ render(url('sylius_shop_partial_cart_add_item', {'template': '@SyliusShop/Product/Show/_addToCart.html.twig', 'productId': product.id})) }}
</div>
{% endif %}
</div>
", "@SyliusShop/Product/Show/_productaction.html.twig", "/home/mons/site/www/templates/bundles/SyliusShopBundle/Product/Show/_productaction.html.twig");
}
}