Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
How do you override the default naming convention for Variants when they are added to an order?
At the moment they include the Parent Product's name, but for our use case it we'd prefer it to just be the variants name.
If you want to replace how Vendr extracts the product name you can replace the IUmbracoProductNameExtractor with your own implementation. You'll need to override the ExtractProductName(IPublishedContent content, IPublishedElement variantContent, string languageIsoCode) and have it retrieve / return the name you require.
ExtractProductName(IPublishedContent content, IPublishedElement variantContent, string languageIsoCode)
You can review the docs here for details on how you replace a Vendr implementation https://vendr.net/docs/core/1.8.0/key-concepts/dependency-injection/#replacing-dependencies
An alternative approach can also be adding a productName property to the order line as this will override any generated name, however this will require you to provide the product name for every order line, so this is generally the better option when you only need to override the odd name here and there, where as replacing the IUmbracoProductNameExtractor is the better option if you want to change how names are generated system wide.
Excellent thank you, I'll have a play with both approaches to see which one fits best.
Thanks again for the super swift response.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted