Thanks for your quick reply, your advice was also my first tought on this.
if (e.ValueSet.Values.ContainsKey("price")) {
using
var ctx = _umbracoContextFactory.EnsureUmbracoContext();
int.TryParse(e.ValueSet.Id, out
var nodeId);
IPublishedContent content = ctx.UmbracoContext.Content.GetById(nodeId);
if (content != null) {
ProductPage product = (ProductPage) content;
if (product != null) {
e.ValueSet.Set("priceWithTax", product.Price.First().Value);
}
}
Examine Price Range Filter
I am working on a custom filter for filtering prices, but I got a bit stuck.
Price is of type: Vendr.Umbraco.Models.PricePropertyValue
What is the best solution here?
Hi Peter,
The price property editor stores it's value in a JSON format like
Where for each currency your store supports there is an entry with the given price for that currency.
To search on these, you'll probably need to extend how they are stored in examine, breaking out the values into individual lucene fields.
See the docs here for how you would add your own fields to the examine / lucene index based on values already in the index https://our.umbraco.com/documentation/reference/searching/examine/examine-events
Hi Matt,
Thanks for your quick reply, your advice was also my first tought on this.
Works great!
is working on a reply...