We're building a multiple site solution with multiple catalogs, one for each site.The problem is that when fetching the url for a product I sometimes get a url where the catalog is for the catalog that the other site uses. Can I somhow choose/get a url based on rights or based on a setting or something?
Does the issue happen with linked products? Please clarify the "sometimes" term - does it happen randomly or on specific products?
By sometimes I mean when that products also is part of another catalog. I guess I get the url for the first catalog in the list, but I want to get the url for the catalog that is setup for the site.
So it happens with linked products.
By default we get the "true" parent catalog content to construct the hierarchical url. So if you want the linked products to work, you will need to create your own partial router, which can inherit from HierarchicalCatalogPartialRouter, and overwrite the TryGetVirtualPath method to get the catalog contents belong to the context you're using.