Show content of custom content type in a block based on taxonomy term 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
What you're trying to do already come out of the box in "Taxonomy term" content views. 

If you have tagged your Store product nodes with taxonomy terms these nodes will appear on the related term pages. You don't need a separate Block, the term pages will show a list of nodes tagged with that term. 

You don't even need the Store content type if its whole purpose is to provide categorization. The "Store" Taxonomy Vocabulary is all you need. 

Can you try and see if that is enough for you? 



In your Contextual configuration you should use the option "Load default filter from term page", and not "Load default filter from node page" because the information is taken from the taxonomy term page, you're not showing a block on a node page. 

Why do you need the second Contextual for NID? This is usually used when you want to exclude the current node from the list (Under More > Exclude), but you're not on a node page so there is nothing to comare the NID to. Remove that second Contextual, you don't need it.