Can we decorate GetCanonical()?

Hi, is there a way for us to change the output of GetCanonical for product pages? We dont always want the first varient to be the canonical.
@NilsN ? :smiley:

Litium version: 7.6

Decorate the Litium.Web.MetaService?

Yes or a different solutions, we can also solve this by overiding the variant sorting option that MetaService is using, but it need to be per website than

MetaService is using the UrlService to fetch the URL, alternative is that you not call the MetaService.GetCanonical and instead resolve the url that you want as canonical in the controller itself.

So that logic that controls what variant becomes the main canonical can’t be adjusted with a decorator?

You can decorate the UrlService and from that one return another url for the product than the system generated based on first variant.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.