Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Script to change SeoUri

Vote:
 

Hi,

We've recently imported products and variants into the Commerce Catalog.  At the time, the SeoUri was set to the format {name}-en.aspx 

The client wants to change the format of the SeoUri to something else.  I've added an implementation of UniqueSeoGenerator that works for new products/variants.

I need to change the existing SeoUri, but when I try to do that I get an error back that the field is readonly.  Is there another way of changing the value of the SeoUri?

Thanks

Danie

#145872
Mar 14, 2016 16:23
Vote:
 

Hi,

I'm not sure how do you change the SeoUri, but it should not be readonly. You can use either EntryContentBase or CatalogEntry.CatalogItemSeo to update it. Perhaps you forgot to call CreateWritableClone()?

You can always update the Uri directly in CatalogItemSeo table. Of course we don't recommend to manipulate database directly, and you'll have to do it at your own risk - but just want to let you know you have the option. Make sure to back up your databases first, as always.

Regards,

/Q

#145873
Mar 14, 2016 16:29
Vote:
 

Hi Quan,

Thanks for your quick reply.

You are right, I've made a mistake in the my code (cloned the entry, but tried to change the entry instead of the cloned object :-)

Thanks 

#145874
Mar 14, 2016 16:36
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.