In D8 I have created two custom content types:
- Store
- Store products
It's not an e-commerce, I just need two custom types to show all the stores on one of the subpages and the products that each store has.
Because there are 24 stores, I would hate to create 24 custom types of a store products, so I also added a taxonomy term field to a Store product.
Now, I would want to show the Store products in a Block, depending on the taxonomy term.
For example: I created Store A, which has products A1, A2, A3. If I go to the page of Store A, there should be a block that shows those products.
If I would go to Store B, the same block would show products of Store B.
I tried following this answer and added a contextual filter, but no luck so far: Display content based on URL
What I did:
- Created a View Block for Store Products
- Added a contextual filter to the block (Has taxonomry term -> taxonomy term ID from URL)
- Also added another contextual filter node:id
- Added the block under blocks to render on the page Store