var/cache/dev/twig/0a/0af15d92b277bdc84ff6ca46911dbc54.php line 110

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\Markup;
  8. use Twig\Sandbox\SecurityError;
  9. use Twig\Sandbox\SecurityNotAllowedTagError;
  10. use Twig\Sandbox\SecurityNotAllowedFilterError;
  11. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  12. use Twig\Source;
  13. use Twig\Template;
  14. use Twig\TemplateWrapper;
  15. /* front/catalog/product/carousel.html.twig */
  16. class __TwigTemplate_072cd256f8634c69a8717ca34622f0b1 extends Template
  17. {
  18. private Source $source;
  19. /**
  20. * @var array<string, Template>
  21. */
  22. private array $macros = [];
  23. public function __construct(Environment $env)
  24. {
  25. parent::__construct($env);
  26. $this->source = $this->getSourceContext();
  27. $this->parent = false;
  28. $this->blocks = [
  29. ];
  30. }
  31. protected function doDisplay(array $context, array $blocks = []): iterable
  32. {
  33. $macros = $this->macros;
  34. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  35. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/catalog/product/carousel.html.twig"));
  36. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  37. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/catalog/product/carousel.html.twig"));
  38. // line 1
  39. if ((($tmp = !array_key_exists("withWrapper", $context)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  40. // line 2
  41. yield " ";
  42. $context["withWrapper"] = false;
  43. }
  44. // line 4
  45. if ((($tmp = !array_key_exists("titleTag", $context)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  46. // line 5
  47. yield " ";
  48. $context["titleTag"] = "div";
  49. }
  50. // line 7
  51. if ((($tmp = (isset($context["withWrapper"]) || array_key_exists("withWrapper", $context) ? $context["withWrapper"] : (function () { throw new RuntimeError('Variable "withWrapper" does not exist.', 7, $this->source); })())) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  52. // line 8
  53. yield "<div class=\"product-carousel-ctn\">
  54. <div class=\"ctn\">
  55. ";
  56. }
  57. // line 11
  58. yield "<div class=\"product-list-ctn\">
  59. ";
  60. // line 12
  61. if ((array_key_exists("title", $context) && (isset($context["title"]) || array_key_exists("title", $context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.', 12, $this->source); })()))) {
  62. // line 13
  63. yield " <div class=\"title-ctn\">
  64. <";
  65. // line 14
  66. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["titleTag"]) || array_key_exists("titleTag", $context) ? $context["titleTag"] : (function () { throw new RuntimeError('Variable "titleTag" does not exist.', 14, $this->source); })()), "html", null, true);
  67. yield " class=\"title\">";
  68. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["title"]) || array_key_exists("title", $context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.', 14, $this->source); })()), "html", null, true);
  69. yield "</";
  70. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["titleTag"]) || array_key_exists("titleTag", $context) ? $context["titleTag"] : (function () { throw new RuntimeError('Variable "titleTag" does not exist.', 14, $this->source); })()), "html", null, true);
  71. yield ">
  72. <hr>
  73. </div>
  74. ";
  75. }
  76. // line 18
  77. yield " <ul class=\"product-list product-carousel\">
  78. ";
  79. // line 19
  80. $context['_parent'] = $context;
  81. $context['_seq'] = CoreExtension::ensureTraversable((isset($context["products"]) || array_key_exists("products", $context) ? $context["products"] : (function () { throw new RuntimeError('Variable "products" does not exist.', 19, $this->source); })()));
  82. $context['loop'] = [
  83. 'parent' => $context['_parent'],
  84. 'index0' => 0,
  85. 'index' => 1,
  86. 'first' => true,
  87. ];
  88. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  89. $length = count($context['_seq']);
  90. $context['loop']['revindex0'] = $length - 1;
  91. $context['loop']['revindex'] = $length;
  92. $context['loop']['length'] = $length;
  93. $context['loop']['last'] = 1 === $length;
  94. }
  95. foreach ($context['_seq'] as $context["_key"] => $context["p"]) {
  96. // line 20
  97. yield " ";
  98. if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["p"], "productModel", [], "any", false, false, false, 20)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  99. // line 21
  100. yield " ";
  101. yield from $this->load("front/catalog/model/view/list-item.html.twig", 21)->unwrap()->yield(CoreExtension::merge($context, ["model" => CoreExtension::getAttribute($this->env, $this->source, $context["p"], "topProductModel", [], "any", false, false, false, 21), "product" => $context["p"]]));
  102. // line 22
  103. yield " ";
  104. } else {
  105. // line 23
  106. yield " ";
  107. yield from $this->load("front/catalog/product/view/list-item.html.twig", 23)->unwrap()->yield(CoreExtension::merge($context, ["product" => $context["p"]]));
  108. // line 24
  109. yield " ";
  110. }
  111. // line 25
  112. yield " ";
  113. ++$context['loop']['index0'];
  114. ++$context['loop']['index'];
  115. $context['loop']['first'] = false;
  116. if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
  117. --$context['loop']['revindex0'];
  118. --$context['loop']['revindex'];
  119. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  120. }
  121. }
  122. $_parent = $context['_parent'];
  123. unset($context['_seq'], $context['_key'], $context['p'], $context['_parent'], $context['loop']);
  124. $context = array_intersect_key($context, $_parent) + $_parent;
  125. // line 26
  126. yield " </ul>
  127. </div>
  128. ";
  129. // line 28
  130. if ((($tmp = (isset($context["withWrapper"]) || array_key_exists("withWrapper", $context) ? $context["withWrapper"] : (function () { throw new RuntimeError('Variable "withWrapper" does not exist.', 28, $this->source); })())) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  131. // line 29
  132. yield " </div>
  133. </div>
  134. ";
  135. }
  136. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  137. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  138. yield from [];
  139. }
  140. /**
  141. * @codeCoverageIgnore
  142. */
  143. public function getTemplateName(): string
  144. {
  145. return "front/catalog/product/carousel.html.twig";
  146. }
  147. /**
  148. * @codeCoverageIgnore
  149. */
  150. public function isTraitable(): bool
  151. {
  152. return false;
  153. }
  154. /**
  155. * @codeCoverageIgnore
  156. */
  157. public function getDebugInfo(): array
  158. {
  159. return array ( 141 => 29, 139 => 28, 135 => 26, 121 => 25, 118 => 24, 115 => 23, 112 => 22, 109 => 21, 106 => 20, 89 => 19, 86 => 18, 75 => 14, 72 => 13, 70 => 12, 67 => 11, 62 => 8, 60 => 7, 56 => 5, 54 => 4, 50 => 2, 48 => 1,);
  160. }
  161. public function getSourceContext(): Source
  162. {
  163. return new Source("{% if withWrapper is not defined %}
  164. {% set withWrapper = false %}
  165. {% endif %}
  166. {% if titleTag is not defined %}
  167. {% set titleTag = \x27div\x27 %}
  168. {% endif %}
  169. {% if withWrapper %}
  170. <div class=\"product-carousel-ctn\">
  171. <div class=\"ctn\">
  172. {% endif %}
  173. <div class=\"product-list-ctn\">
  174. {% if title is defined and title %}
  175. <div class=\"title-ctn\">
  176. <{{ titleTag }} class=\"title\">{{ title }}</{{ titleTag }}>
  177. <hr>
  178. </div>
  179. {% endif %}
  180. <ul class=\"product-list product-carousel\">
  181. {% for p in products %}
  182. {% if p.productModel %}
  183. {% include \x27front/catalog/model/view/list-item.html.twig\x27 with {model:p.topProductModel, product:p} %}
  184. {% else %}
  185. {% include \x27front/catalog/product/view/list-item.html.twig\x27 with {product:p} %}
  186. {% endif %}
  187. {% endfor %}
  188. </ul>
  189. </div>
  190. {% if withWrapper %}
  191. </div>
  192. </div>
  193. {% endif %}", "front/catalog/product/carousel.html.twig", "/var/www/dogcat.com/pim/templates/front/catalog/product/carousel.html.twig");
  194. }
  195. }