var/cache/dev_hc896b0aecebc6aae6bec469c82cd525f/twig/b6/b6d365bfada0ce3a5790b338cfa8105afaf585aa4ecb0a96c9b59acc0f0fce9e.php line 41

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use function Shopware\Core\Framework\Adapter\Twig\sw_get_attribute;
  4. use function Shopware\Core\Framework\Adapter\Twig\sw_escape_filter;
  5. use Twig\Error\LoaderError;
  6. use Twig\Error\RuntimeError;
  7. use Twig\Extension\SandboxExtension;
  8. use Twig\Markup;
  9. use Twig\Sandbox\SecurityError;
  10. use Twig\Sandbox\SecurityNotAllowedTagError;
  11. use Twig\Sandbox\SecurityNotAllowedFilterError;
  12. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  13. use Twig\Source;
  14. use Twig\Template;
  15. /* @EfbStorefront/storefront/page/product-detail/meta.html.twig */
  16. class __TwigTemplate_f3f5d560aa5a5bf9c64a1b67b9c1edff extends Template
  17. {
  18.     private $source;
  19.     private $macros = [];
  20.     public function __construct(Environment $env)
  21.     {
  22.         parent::__construct($env);
  23.         $this->source $this->getSourceContext();
  24.         $this->blocks = [
  25.             'layout_head_meta_tags_opengraph' => [$this'block_layout_head_meta_tags_opengraph'],
  26.             'dreisc_seo__layout_head_meta_tags__ld_json' => [$this'block_dreisc_seo__layout_head_meta_tags__ld_json'],
  27.         ];
  28.     }
  29.     protected function doGetParent(array $context)
  30.     {
  31.         // line 2
  32.         return "@EfbStorefront/storefront/layout/meta.html.twig";
  33.     }
  34.     protected function doDisplay(array $context, array $blocks = [])
  35.     {
  36.         $macros $this->macros;
  37.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  38.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@EfbStorefront/storefront/page/product-detail/meta.html.twig"));
  39.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  40.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@EfbStorefront/storefront/page/product-detail/meta.html.twig"));
  41.         $this->parent $this->loadTemplate("@EfbStorefront/storefront/layout/meta.html.twig""@EfbStorefront/storefront/page/product-detail/meta.html.twig"2);
  42.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  43.         
  44.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  45.         
  46.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  47.     }
  48.     // line 3
  49.     public function block_layout_head_meta_tags_opengraph($context, array $blocks = [])
  50.     {
  51.         $macros $this->macros;
  52.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  53.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""layout_head_meta_tags_opengraph"));
  54.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  55.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""layout_head_meta_tags_opengraph"));
  56.         // line 4
  57.         echo "    <meta property=\"og:type\"
  58.           content=\"product\"/>
  59.     <meta property=\"og:site_name\"
  60.           content=\"";
  61.         // line 7
  62.         echo sw_escape_filter($this->env$this->extensions['Shopware\Storefront\Framework\Twig\Extension\ConfigExtension']->config($context"core.basicInformation.shopName"), "html"nulltrue);
  63.         echo "\"/>
  64.     <meta property=\"og:url\"
  65.           content=\"";
  66.         // line 9
  67.         echo sw_escape_filter($this->env$this->extensions['Shopware\Core\Framework\Adapter\Twig\Extension\SeoUrlFunctionExtension']->seoUrl("frontend.detail.page", ["productId" => sw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "product", [], "any"falsefalsefalse9), "id", [], "any"falsefalsefalse9)]), "html"nulltrue);
  68.         echo "\"/>
  69.     <meta property=\"og:title\"
  70.           content=\"";
  71.         // line 11
  72.         echo sw_escape_filter($this->env, ($context["metaTitle"] ?? null), "html"nulltrue);
  73.         echo "\"/>
  74.     <meta property=\"og:description\"
  75.           content=\"";
  76.         // line 14
  77.         echo sw_escape_filter($this->env, ($context["metaDescription"] ?? null), "html"nulltrue);
  78.         echo "\"/>
  79.     <meta property=\"og:image\"
  80.           content=\"";
  81.         // line 16
  82.         echo sw_escape_filter($this->envsw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "product", [], "any"falsefalsefalse16), "cover", [], "any"falsefalsefalse16), "media", [], "any"falsefalsefalse16), "url", [], "any"falsefalsefalse16), "html"nulltrue);
  83.         echo "\"/>
  84.     ";
  85.         // line 18
  86.         if (sw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "product", [], "any"falsefalsefalse18), "manufacturer", [], "any"falsefalsefalse18)) {
  87.             // line 19
  88.             echo "        <meta property=\"product:brand\"
  89.               content=\"";
  90.             // line 20
  91.             echo sw_escape_filter($this->envsw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "product", [], "any"falsefalsefalse20), "manufacturer", [], "any"falsefalsefalse20), "translated", [], "any"falsefalsefalse20), "name", [], "any"falsefalsefalse20), "html"nulltrue);
  92.             echo "\"/>
  93.     ";
  94.         }
  95.         // line 22
  96.         echo "
  97.     ";
  98.         // line 23
  99.         $context["metaPrice"] = sw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "product", [], "any"falsefalsefalse23), "calculatedPrice", [], "any"falsefalsefalse23);
  100.         // line 24
  101.         echo "    ";
  102.         if ((sw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "product", [], "any"falsefalsefalse24), "calculatedPrices", [], "any"falsefalsefalse24), "count", [], "any"falsefalsefalse24) > 0)) {
  103.             // line 25
  104.             echo "        ";
  105.             $context["metaPrice"] = sw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "product", [], "any"falsefalsefalse25), "calculatedPrices", [], "any"falsefalsefalse25), "last", [], "any"falsefalsefalse25);
  106.             // line 26
  107.             echo "    ";
  108.         }
  109.         // line 27
  110.         echo "    ";
  111.         if (sw_get_attribute($this->env$this->source, ($context["context"] ?? null), "customer", [], "any"falsefalsefalse27)) {
  112.             // line 28
  113.             echo "        <meta property=\"product:price:amount\" content=\"";
  114.             echo sw_escape_filter($this->envtwig_round(sw_get_attribute($this->env$this->source, ($context["metaPrice"] ?? null), "unitPrice", [], "any"falsefalsefalse28), sw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["context"] ?? null), "currency", [], "any"falsefalsefalse28), "itemRounding", [], "any"falsefalsefalse28), "decimals", [], "any"falsefalsefalse28)), "html"nulltrue);
  115.             echo "\"/>
  116.     ";
  117.         }
  118.         // line 30
  119.         echo "    <meta property=\"product:price:currency\"
  120.           content=\"";
  121.         // line 31
  122.         echo sw_escape_filter($this->envsw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["context"] ?? null), "currency", [], "any"falsefalsefalse31), "isoCode", [], "any"falsefalsefalse31), "html"nulltrue);
  123.         echo "\"/>
  124.     <meta property=\"product:product_link\"
  125.           content=\"";
  126.         // line 33
  127.         echo sw_escape_filter($this->env$this->extensions['Shopware\Core\Framework\Adapter\Twig\Extension\SeoUrlFunctionExtension']->seoUrl("frontend.detail.page", ["productId" => sw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "product", [], "any"falsefalsefalse33), "id", [], "any"falsefalsefalse33)]), "html"nulltrue);
  128.         echo "\"/>
  129.     <meta name=\"twitter:card\"
  130.           content=\"product\"/>
  131.     <meta name=\"twitter:site\"
  132.           content=\"";
  133.         // line 38
  134.         echo sw_escape_filter($this->env$this->extensions['Shopware\Storefront\Framework\Twig\Extension\ConfigExtension']->config($context"core.basicInformation.shopName"), "html"nulltrue);
  135.         echo "\"/>
  136.     <meta name=\"twitter:title\"
  137.           content=\"";
  138.         // line 40
  139.         echo sw_escape_filter($this->env, ($context["metaTitle"] ?? null), "html"nulltrue);
  140.         echo "\"/>
  141.     <meta name=\"twitter:description\"
  142.           content=\"";
  143.         // line 42
  144.         echo sw_escape_filter($this->env, ($context["metaDescription"] ?? null), "html"nulltrue);
  145.         echo "\"/>
  146.     <meta name=\"twitter:image\"
  147.           content=\"";
  148.         // line 44
  149.         echo sw_escape_filter($this->envsw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->sourcesw_get_attribute($this->env$this->source, ($context["page"] ?? null), "product", [], "any"falsefalsefalse44), "cover", [], "any"falsefalsefalse44), "media", [], "any"falsefalsefalse44), "url", [], "any"falsefalsefalse44), "html"nulltrue);
  150.         echo "\"/>
  151. ";
  152.         
  153.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  154.         
  155.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  156.     }
  157.     // line 47
  158.     public function block_dreisc_seo__layout_head_meta_tags__ld_json($context, array $blocks = [])
  159.     {
  160.         $macros $this->macros;
  161.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  162.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""dreisc_seo__layout_head_meta_tags__ld_json"));
  163.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  164.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""dreisc_seo__layout_head_meta_tags__ld_json"));
  165.         // line 48
  166.         echo "    ";
  167.         // line 49
  168.         echo "    ";
  169.         $context["richSnippetDataStruct"] = (($__internal_compile_0 sw_get_attribute($this->env$this->source, ($context["page"] ?? null), "extensions", [], "any"falsefalsefalse49)) && is_array($__internal_compile_0) || $__internal_compile_0 instanceof ArrayAccess ? ($__internal_compile_0[twig_constant("DreiscSeoPro\\Subscriber\\Installment\\RichSnippet\\RichSnippetSubscriber::DREISC_SEO_INSTALLMENT_RICH_SNIPPET_DATA")] ?? null) : null);
  170.         // line 50
  171.         echo "    ";
  172.         $context["modifiedRichSnippetDataStruct"] = [];
  173.         // line 51
  174.         echo "
  175.     ";
  176.         // line 52
  177.         $context['_parent'] = $context;
  178.         $context['_seq'] = twig_ensure_traversable(sw_get_attribute($this->env$this->source, ($context["richSnippetDataStruct"] ?? null), "ldJson", [], "any"falsefalsefalse52));
  179.         foreach ($context['_seq'] as $context["_key"] => $context["snippet"]) {
  180.             // line 53
  181.             echo "        ";
  182.             if (((($__internal_compile_1 $context["snippet"]) && is_array($__internal_compile_1) || $__internal_compile_1 instanceof ArrayAccess ? ($__internal_compile_1["@type"] ?? null) : null) == "Product")) {
  183.                 // line 54
  184.                 echo "            ";
  185.                 $context["updated_offers"] = [];
  186.                 // line 55
  187.                 echo "            ";
  188.                 $context['_parent'] = $context;
  189.                 $context['_seq'] = twig_ensure_traversable(sw_get_attribute($this->env$this->source$context["snippet"], "offers", [], "any"falsefalsefalse55));
  190.                 foreach ($context['_seq'] as $context["_key"] => $context["offer"]) {
  191.                     // line 56
  192.                     echo "                ";
  193.                     $context["filtered_offer"] = twig_array_merge($context["offer"], ["price" => null]);
  194.                     // line 57
  195.                     echo "                ";
  196.                     $context["filtered_offer"] = $this->extensions['Shopware\Core\Framework\Adapter\Twig\SecurityExtension']->filter(($context["filtered_offer"] ?? null), function ($__key__$__value__) use ($context$macros) { $context["key"] = $__key__$context["value"] = $__value__; return (($context["key"] ?? null) != "price"); });
  197.                     // line 58
  198.                     echo "                ";
  199.                     $context["updated_offers"] = twig_array_merge(($context["updated_offers"] ?? null), [=> ($context["filtered_offer"] ?? null)]);
  200.                     // line 59
  201.                     echo "            ";
  202.                 }
  203.                 $_parent $context['_parent'];
  204.                 unset($context['_seq'], $context['_iterated'], $context['_key'], $context['offer'], $context['_parent'], $context['loop']);
  205.                 $context array_intersect_key($context$_parent) + $_parent;
  206.                 // line 60
  207.                 echo "
  208.             ";
  209.                 // line 61
  210.                 $context["snippet"] = twig_array_merge($context["snippet"], ["offers" => ($context["updated_offers"] ?? null)]);
  211.                 // line 62
  212.                 echo "        ";
  213.             }
  214.             // line 63
  215.             echo "
  216.         ";
  217.             // line 64
  218.             $context["modifiedRichSnippetDataStruct"] = twig_array_merge(($context["modifiedRichSnippetDataStruct"] ?? null), [=> $context["snippet"]]);
  219.             // line 65
  220.             echo "    ";
  221.         }
  222.         $_parent $context['_parent'];
  223.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['snippet'], $context['_parent'], $context['loop']);
  224.         $context array_intersect_key($context$_parent) + $_parent;
  225.         // line 66
  226.         echo "
  227.     ";
  228.         // line 67
  229.         if ( !(null === ($context["modifiedRichSnippetDataStruct"] ?? null))) {
  230.             // line 68
  231.             echo "        <script type=\"application/ld+json\">
  232.             ";
  233.             // line 69
  234.             echo $this->env->getFilter('json_encode')->getCallable()(($context["modifiedRichSnippetDataStruct"] ?? null));
  235.             echo "
  236.         </script>
  237.     ";
  238.         }
  239.         
  240.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  241.         
  242.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  243.     }
  244.     public function getTemplateName()
  245.     {
  246.         return "@EfbStorefront/storefront/page/product-detail/meta.html.twig";
  247.     }
  248.     public function isTraitable()
  249.     {
  250.         return false;
  251.     }
  252.     public function getDebugInfo()
  253.     {
  254.         return array (  254 => 69,  251 => 68,  249 => 67,  246 => 66,  240 => 65,  238 => 64,  235 => 63,  232 => 62,  230 => 61,  227 => 60,  221 => 59,  218 => 58,  215 => 57,  212 => 56,  207 => 55,  204 => 54,  201 => 53,  197 => 52,  194 => 51,  191 => 50,  188 => 49,  186 => 48,  176 => 47,  164 => 44,  159 => 42,  154 => 40,  149 => 38,  141 => 33,  136 => 31,  133 => 30,  127 => 28,  124 => 27,  121 => 26,  118 => 25,  115 => 24,  113 => 23,  110 => 22,  105 => 20,  102 => 19,  100 => 18,  95 => 16,  90 => 14,  84 => 11,  79 => 9,  74 => 7,  69 => 4,  59 => 3,  36 => 2,);
  255.     }
  256.     public function getSourceContext()
  257.     {
  258.         return new Source("{% sw_extends '@Storefront/storefront/layout/meta.html.twig' %}
  259. {% block layout_head_meta_tags_opengraph %}
  260.     <meta property=\"og:type\"
  261.           content=\"product\"/>
  262.     <meta property=\"og:site_name\"
  263.           content=\"{{ config('core.basicInformation.shopName') }}\"/>
  264.     <meta property=\"og:url\"
  265.           content=\"{{ seoUrl('frontend.detail.page', { productId: page.product.id }) }}\"/>
  266.     <meta property=\"og:title\"
  267.           content=\"{{ metaTitle }}\"/>
  268.     <meta property=\"og:description\"
  269.           content=\"{{ metaDescription }}\"/>
  270.     <meta property=\"og:image\"
  271.           content=\"{{ page.product.cover.media.url }}\"/>
  272.     {% if page.product.manufacturer %}
  273.         <meta property=\"product:brand\"
  274.               content=\"{{ page.product.manufacturer.translated.name }}\"/>
  275.     {% endif %}
  276.     {% set metaPrice = page.product.calculatedPrice %}
  277.     {% if page.product.calculatedPrices.count > 0 %}
  278.         {% set metaPrice = page.product.calculatedPrices.last %}
  279.     {% endif %}
  280.     {% if context.customer %}
  281.         <meta property=\"product:price:amount\" content=\"{{ metaPrice.unitPrice|round(context.currency.itemRounding.decimals) }}\"/>
  282.     {% endif %}
  283.     <meta property=\"product:price:currency\"
  284.           content=\"{{ context.currency.isoCode }}\"/>
  285.     <meta property=\"product:product_link\"
  286.           content=\"{{ seoUrl('frontend.detail.page', { productId: page.product.id }) }}\"/>
  287.     <meta name=\"twitter:card\"
  288.           content=\"product\"/>
  289.     <meta name=\"twitter:site\"
  290.           content=\"{{ config('core.basicInformation.shopName') }}\"/>
  291.     <meta name=\"twitter:title\"
  292.           content=\"{{ metaTitle }}\"/>
  293.     <meta name=\"twitter:description\"
  294.           content=\"{{ metaDescription }}\"/>
  295.     <meta name=\"twitter:image\"
  296.           content=\"{{ page.product.cover.media.url }}\"/>
  297. {% endblock %}
  298. {% block dreisc_seo__layout_head_meta_tags__ld_json %}
  299.     {# remove price from jsonld serp #}
  300.     {% set richSnippetDataStruct = page.extensions[constant('DreiscSeoPro\\\\Subscriber\\\\Installment\\\\RichSnippet\\\\RichSnippetSubscriber::DREISC_SEO_INSTALLMENT_RICH_SNIPPET_DATA')] %}
  301.     {% set modifiedRichSnippetDataStruct = [] %}
  302.     {% for snippet in richSnippetDataStruct.ldJson %}
  303.         {% if snippet['@type'] == 'Product' %}
  304.             {% set updated_offers = [] %}
  305.             {% for offer in snippet.offers %}
  306.                 {% set filtered_offer = offer|merge({'price': null}) %}
  307.                 {% set filtered_offer = filtered_offer|filter((key, value) => key != 'price') %}
  308.                 {% set updated_offers = updated_offers|merge([filtered_offer]) %}
  309.             {% endfor %}
  310.             {% set snippet = snippet|merge({'offers': updated_offers}) %}
  311.         {% endif %}
  312.         {% set modifiedRichSnippetDataStruct = modifiedRichSnippetDataStruct|merge([snippet]) %}
  313.     {% endfor %}
  314.     {% if modifiedRichSnippetDataStruct is not null %}
  315.         <script type=\"application/ld+json\">
  316.             {{ modifiedRichSnippetDataStruct|json_encode|raw }}
  317.         </script>
  318.     {% endif %}
  319. {% endblock %}""@EfbStorefront/storefront/page/product-detail/meta.html.twig""/var/www/share/efb-elektronik.dev.mc.emzcustomers.de/shopware6/custom/static-plugins/EfbStorefront/Resources/views/storefront/page/product-detail/meta.html.twig");
  320.     }
  321. }