Search Products in PageNotFoundResolverDecorator

Hi,

I’m trying to create 301 for old urls that excisted on the old ecommerce solution. We have imported all the old urls to to Litium and would like the PageNotFoundResolverDecorator to try and find products that has that value in the field “oldUrl”.
When I’m using ProductSearchService in TryGet the RequestModelAccessor has not been initialized correctly. Should I use a different service or do I have to write my own productsearchservice?

I don’t think I should use data queries with the risk of getting to many requests to the database.

Litium version: 7.6.4

Mabye this can help Resolve new url to page from old url - #3 by Ericsj11

No that’s not really what I’m trying to do.

I think the PageNotFoundResolver comes earlier in the chain so the RequestModel won’t be set by that time. It’s probably easiest in this case to create your own query for that particular product field and then try to get the URL for the current channel (available in RouteRequestLookupInfo).

1 Like