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
I'm trying to create a simple override for the GetName method, in the documentation it suggests that this can be achieved with something similar to this, I have copied the GetName method from the original, but am returning "testName" just so that I confirm whether or not it is working
public class CustomPublishedContentProductInformationExtractor : PublishedContentProductInformationExtractor
public CustomPublishedContentProductInformationExtractor(IStoreService storeService, ICurrencyService currencyService, IVatGroupService vatGroupService, IVariantService<IPublishedContent, VariantPublishedContent> variantService)
: base(storeService, currencyService, vatGroupService, variantService)
public override string GetName(IPublishedContent product, VariantPublishedContent variant = null)
string name = GetPropertyValue<string>(product, Constants.ProductPropertyAliases.NamePropertyAlias, variant, recursive: variant == null);
//If no name is found - default to the umbraco node name
if (variant != null)
name = GetPropertyValue<string>(product, Constants.ProductPropertyAliases.NamePropertyAlias);
if (variant == null)
name = product.Name;
if (variant != null)
name += " - " + variant.Name;
return "test name";
//return product.GetVortoValue<string>("productName") + (variant != null ? " - " + variant.GetVortoValue<string>("productName") : "");
I would expect that any products that are added to my order would appear as "test name". But it seems to be using the default productName/ variant combination, not using my overridden version, am I misunderstanding/ missing something?
I have written an e-mail to you with an example. I hope that helps.
Just facing this problem, what was the solution?
Throw me an e-mail and I will forward you the same mail I sent Julian.
I have the exact same problem. Could I please have the solution also!
Also cant' override the GetOriginalUnitPrices method either.
Of cause. Throw me an e-mail and I'll send it to you.
Thanks! Slight problem, and this is probably as dumb as it sounds. How do I send you an email?
I spoke to Rune yesterday and I believe the fix should be to use the following SuppressDependency attributes on your class:
[SuppressDependency( "TeaCommerce.Api.InformationExtractors.IProductInformationExtractor", "TeaCommerce.Api" )]
[SuppressDependency( "TeaCommerce.Api.InformationExtractors.IProductInformationExtractor`1[[Umbraco.Core.Models.IPublishedContent, Umbraco.Core]]", "TeaCommerce.Api" )]
[SuppressDependency( "TeaCommerce.Api.InformationExtractors.IProductInformationExtractor`2[[Umbraco.Core.Models.IPublishedContent, Umbraco.Core], [TeaCommerce.Umbraco.Configuration.Variants.Models.VariantPublishedContent, TeaCommerce.Umbraco.Configuration]]", "TeaCommerce.Api" )]
Instead of the one mentioned in the docs:
Give this a try and let me know how you get on.
Hi Matt and Rune,
Thanks for sharing this. Everything works as expected now.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted