Quantcast
Channel: Using Optimizely Platforms
Viewing all articles
Browse latest Browse all 8020

Obtaining a price for a specific content reference/variant

$
0
0

Hello all,

I'm working on a feature that requires the lookup of pricing of a particular content reference - here is the code I currently have, based upon the documentation/posts and articles I've read, it looks like I need to use the PriceService to lookup the price based upon a CatalogKey - but I'm unsure on what object, or what service I need to use in order to look up the pricing information?

Currently I have this lookup that is working correctly for retreiving the relevant data:

var contentReference = _referenceConverter.GetContentLink(req.itemCode);
                    List<ContentReference> references = new List<ContentReference>();
                    references.Add(contentReference);
                    var variantContent = _contentRepository.GetItems(references, CultureInfo.InvariantCulture).Cast<VariationContent>()
                                                    .ToList(); ;

Based upon documentation, I was working on gathering the pricing data for the items in reference by:

decimal price = _priceService.GetPrices(Mediachase.Commerce.MarketId.Default, DateTime.UtcNow,{Catalog_Key?} ,  null);

What is the best method to retrieve the relevant CatalogKey for my loaded data?

Thank you!


Viewing all articles
Browse latest Browse all 8020

Trending Articles