Developer forum

Forum » Development » Get prices from price matrix in index extender

Get prices from price matrix in index extender

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

How do I get product prices from the price matrix in an index extender? I have this code:

var product = Dynamicweb.Ecommerce.Services.Products.GetProductById(productId, variantId, languageId);

but then I get this:

I looked into the Services but see nothing for the Price Matrix.

Thanks!


Replies

 
Nicolai Pedersen
Reply

Hi Imar

Yeah, there might be some context issues on that call.

What version is this? And what are you trying to achieve - what kind of information are you putting into the index?

BR Nicolai

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

I am trying to add currency-specific prices to the index so I can have price range filters with ranges for specific currencies. i.e. 0-20, 20-40 in Euro and 0-140, 140-280 in DKK.

 
Nicolai Pedersen
Reply

Hi Imar

Those fields should already be there, with and without VAT...:

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Yes, I have seen them, but not matter what I tried, they always come up as empty. Here's what Luke says:

The data for the terms looks weird, but maybe that's just a Luke display issue:

I see the index builder has some custom logic with conditions that may explain why these show up as empty, so that's why I attempted to add my own. 

I managed to get my custom price data in the index using an index extender, but as soon as I add a Range field on top of it, my data disappears again so I am somewhat at loss here.

Thanks!

Imar

 

 
Nicolai Pedersen
Reply

Hi Imar

I will send you an email from QA so you can see some of their findings on this.

Can you show us your prices? Especially - do they have a language on them?

BR Nicolai

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Had a breakthrough yesterday. There was no language on them but that didn't seem to matter. What did make the difference is PriceIsInformative. We're importing the prices from NAV and never set that field during the integration which means they got a null value. The index builder filters on PriceIsInformative = 0 explicitly. 

Still not sure why adding my own fields didn't work and still having a bunch of other issues, but at least I am making some progress....

 

You must be logged in to post in the forum