Maybe this is something that can be reported to support as a bug? It seems to me like catalog content is loaded in wrong language context.
I don't know about the routing in Commerce, but if you render a canoncial link "@Html.CanonicalLink()" you shouldn't need to worry about duplicated content.
I'm using Jetbrains Rider and my feeling is that it's much better on debugging decompiled Episerver code, not sure about Visual Studio. Anyway, if you can debug decompiled code - I would try to put breakpoints in any class within the namespace EPiServer.Web.Routing.Segments.Internal - for example RequestSegmentContext, PartialSegment, NodeSegment, LanguageSegment and LanguageSegmentMatcher. This should allow you to figure out how Episerver resolves the content for some URL.
Nice mustache btw!
Hello! I'm having an issue with catalog routing that I can't seem to resolve.
We have multiple page trees in different languages, each language is tied to a different market, but all sites are using the same catalog.
So we have for example this setup where this is the same category, but in different languages and markets
https://www.example.se/kategori1/
https://www.example.com/category1/
But if I add language segment to the url I can still hit the swedish products on the english site even though swedish is not enabled for the website
https://www.example.com/sv/kategori1/
For SEO reasons we would Ideally like this to be a 404. Any ideas on how to acvieve this?
I've been messing around with catalog routing, my idea was returning null in the RoutePartial on some sort of condition would fix this, but RoutePartial is never hit when visiting this url https://www.example.com/sv/kategori1/
So basically I need som tips on where to start digging.