【问题标题】:Shopware SEO URL with product options names in itShopware SEO URL,其中包含产品选项名称
【发布时间】:2021-02-14 20:57:52
【问题描述】:

我想要这样的产品网址:

bla.com/product_name_bla_white_140cm

白色和 140 厘米是我可以在给定产品中选择的选项。

我想我可以通过 SEO URL 模板设置它:

{{ product.translated.name}}{%for opt in product.options %}_{{opt.name}}{%endfor%}

但是有了这个设置,url就像:bla.com/detail/261927b50317410ba8eecc97d77c3b7e

怎么了?

【问题讨论】:

    标签: shopware shopware5


    【解决方案1】:

    \Shopware\Storefront\Framework\Seo\SeoUrlRoute\ProductPageSeoUrlRoute::prepareCriteria 中,options 和 options.group 的关联未加载,因此您将无法访问此数据。最简单的方法是通过插件添加这些条件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-09-26
      • 1970-01-01
      • 2016-01-21
      • 1970-01-01
      • 1970-01-01
      • 2019-06-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多