var/cache/dev/twig/91/91fc370a0c00ec58b862eacc42ccced0.php line 43

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/_addToCart.html.twig */
  14. class __TwigTemplate_3f9a0a4ef7388f1e2388a9b6327ae63a 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_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  30. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@SyliusShop/Product/Show/_addToCart.html.twig"));
  31. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  32. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@SyliusShop/Product/Show/_addToCart.html.twig"));
  33. // line 1
  34. $context["product"] = twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["order_item"]) || array_key_exists("order_item", $context) ? $context["order_item"] : (function () { throw new RuntimeError('Variable "order_item" does not exist.', 1, $this->source); })()), "variant", [], "any", false, false, false, 1), "product", [], "any", false, false, false, 1);
  35. // line 2
  36. echo "
  37. ";
  38. // line 3
  39. $this->env->getRuntime("Symfony\\Component\\Form\\FormRenderer")->setTheme((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 3, $this->source); })()), [0 => "@SyliusShop/Form/theme.html.twig"], true);
  40. // line 4
  41. echo "
  42. <div class=\"ui segment\" id=\"sylius-product-selecting-variant\">
  43. ";
  44. // line 6
  45. echo $this->env->getRuntime('Sonata\BlockBundle\Templating\Helper\BlockHelper')->renderEvent("sylius.shop.product.show.before_add_to_cart", ["product" => (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 6, $this->source); })()), "order_item" => (isset($context["order_item"]) || array_key_exists("order_item", $context) ? $context["order_item"] : (function () { throw new RuntimeError('Variable "order_item" does not exist.', 6, $this->source); })())]);
  46. echo "
  47. ";
  48. // line 8
  49. echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 8, $this->source); })()), 'form_start', ["action" => $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("sylius_shop_ajax_cart_add_item", ["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.', 8, $this->source); })()), "id", [], "any", false, false, false, 8)]), "attr" => ["id" => "sylius-product-adding-to-cart", "class" => "ui loadable form", "novalidate" => "novalidate", "data-redirect" => $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath(twig_get_attribute($this->env, $this->source, (isset($context["configuration"]) || array_key_exists("configuration", $context) ? $context["configuration"] : (function () { throw new RuntimeError('Variable "configuration" does not exist.', 8, $this->source); })()), "getRedirectRoute", [0 => "summary"], "method", false, false, false, 8))]]);
  50. echo "
  51. ";
  52. // line 9
  53. echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 9, $this->source); })()), 'errors');
  54. echo "
  55. <div class=\"ui red label bottom pointing hidden sylius-validation-error\" id=\"sylius-cart-validation-error\"></div>
  56. ";
  57. // line 11
  58. 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.', 11, $this->source); })()), "simple", [], "any", false, false, false, 11)) {
  59. // line 12
  60. echo " ";
  61. 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.', 12, $this->source); })()), "variantSelectionMethodChoice", [], "any", false, false, false, 12)) {
  62. // line 13
  63. echo " ";
  64. $this->loadTemplate("@SyliusShop/Product/Show/_variants.html.twig", "@SyliusShop/Product/Show/_addToCart.html.twig", 13)->display($context);
  65. // line 14
  66. echo " ";
  67. } else {
  68. // line 15
  69. echo " ";
  70. $this->loadTemplate("@SyliusShop/Product/Show/_options.html.twig", "@SyliusShop/Product/Show/_addToCart.html.twig", 15)->display($context);
  71. // line 16
  72. echo " ";
  73. }
  74. // line 17
  75. echo " ";
  76. }
  77. // line 18
  78. echo "
  79. ";
  80. // line 26
  81. echo "
  82. ";
  83. // line 27
  84. echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 27, $this->source); })()), "_token", [], "any", false, false, false, 27), 'row');
  85. echo "
  86. ";
  87. // line 28
  88. echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 28, $this->source); })()), 'form_end', ["render_rest" => false]);
  89. echo "
  90. </div>
  91. ";
  92. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  93. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  94. }
  95. public function getTemplateName()
  96. {
  97. return "@SyliusShop/Product/Show/_addToCart.html.twig";
  98. }
  99. public function isTraitable()
  100. {
  101. return false;
  102. }
  103. public function getDebugInfo()
  104. {
  105. return array ( 98 => 28, 94 => 27, 91 => 26, 88 => 18, 85 => 17, 82 => 16, 79 => 15, 76 => 14, 73 => 13, 70 => 12, 68 => 11, 63 => 9, 59 => 8, 54 => 6, 50 => 4, 48 => 3, 45 => 2, 43 => 1,);
  106. }
  107. public function getSourceContext()
  108. {
  109. return new Source("{% set product = order_item.variant.product %}
  110. {% form_theme form '@SyliusShop/Form/theme.html.twig' %}
  111. <div class=\"ui segment\" id=\"sylius-product-selecting-variant\">
  112. {{ sonata_block_render_event('sylius.shop.product.show.before_add_to_cart', {'product': product, 'order_item': order_item}) }}
  113. {{ form_start(form, {'action': path('sylius_shop_ajax_cart_add_item', {'productId': product.id}), 'attr': {'id': 'sylius-product-adding-to-cart', 'class': 'ui loadable form', 'novalidate': 'novalidate', 'data-redirect': path(configuration.getRedirectRoute('summary'))}}) }}
  114. {{ form_errors(form) }}
  115. <div class=\"ui red label bottom pointing hidden sylius-validation-error\" id=\"sylius-cart-validation-error\"></div>
  116. {% if not product.simple %}
  117. {% if product.variantSelectionMethodChoice %}
  118. {% include '@SyliusShop/Product/Show/_variants.html.twig' %}
  119. {% else %}
  120. {% include '@SyliusShop/Product/Show/_options.html.twig' %}
  121. {% endif %}
  122. {% endif %}
  123. {# ADD TO BASKET #}
  124. {#
  125. {{ form_row(form.cartItem.quantity) }}
  126. {{ sonata_block_render_event('sylius.shop.product.show.add_to_cart_form', {'product': product, 'order_item': order_item}) }}
  127. <button type=\"submit\" class=\"ui huge primary icon labeled button\"><i class=\"cart icon\"></i> {{ 'sylius.ui.add_to_cart'|trans }}</button>
  128. #}
  129. {{ form_row(form._token) }}
  130. {{ form_end(form, {'render_rest': false}) }}
  131. </div>
  132. ", "@SyliusShop/Product/Show/_addToCart.html.twig", "/home/hephaestos.eu/public_html/hephsite/templates/bundles/SyliusShopBundle/Product/Show/_addToCart.html.twig");
  133. }
  134. }