The answer is dynamic, you will need to assign the data source to the rendering. As we know that rendering depends on the RenderingContext.Current.Rendering.DataSource
and instead of assigning the data source in presentation details rendering, you will need to assign it dynamically.
To achieve this you need to write one pipeline mvc.getRenderer
and assign the data source runtime by overriding the process method of the pipeline based on the URL requested. So once you will hit the All products page URL with the product code or name, we will get that product item from the Global Repository/Products folder
and assign it to the rendering data source, if it does not found then we will redirect it to the 404 pages
.
About the implementation, you can refer to blog post: Implement Wild Card in SitecoreWildcard Item in Sitecore