简体   繁体   English

在 Drupal 8. Drupal 商务。 如何根据产品字段隐藏视图(实体参考 - 分类)

[英]In Drupal 8. Drupal Commerce. How to hide a view based on Product field (Entity Reference - Taxonomy)

If I clicked a certain Product, it will be redirect to Product Page.如果我单击某个产品,它将被重定向到产品页面。 Within this page, views will be shown or hides base on Product Category.在此页面中,视图将根据产品类别显示或隐藏。

Example.例子。

If Product Category is A. - Shows View A and, - Hides View B.如果产品类别为 A。 - 显示视图 A 并且 - 隐藏视图 B。

If Product Category is B. - Shows View B and, - Hides View A如果产品类别为 B。 - 显示视图 B 并且 - 隐藏视图 A

I would suggest looking into Contextual filters with a reference to the fields in question.我建议参考相关字段来查看上下文过滤器。 i added the do website info on contextual filters.我在上下文过滤器上添加了 do 网站信息。 But if your using commerce guys profile, checkout some of the checkout view setup.但是,如果您使用商务人士的个人资料,请查看一些结帐视图设置。

https://www.drupal.org/docs/8/core/modules/views/add-a-contextual-filter-to-a-view https://www.drupal.org/docs/8/core/modules/views/add-a-contextual-filter-to-a-view

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM