简体   繁体   中英

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.

If Product Category is B. - Shows View B and, - Hides View 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. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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