Developer forum

Forum » Development » Unable to retrieve tiered prices

Unable to retrieve tiered prices

Wilfred Polderman
Reply

Hi,

I’m currently working on implementing tiered pricing (adaptive pricing) based on the order quantity of a client. In the attached screenshot, you can see the data I’m currently receiving for the product I’m testing with.

At the moment, I’m only able to retrieve and display the standard ProductPrice. However, I’m unable to access or display the Recommended_quantity_price (i.e., the tiered prices).

My use case is to show different price levels depending on the ordered quantity, but these tiered prices are not appearing in the data I’m working with. Right now, I only get the default price, which seems to be directly available in Dynamicweb.

What makes this more confusing is that on another page within the same project, I am able to see the tiered prices displayed correctly.

I have tried to reuse and apply the same logic from that page, but in this context it still does not return the expected data. Instead, the Recommended_quantity remains 0.

From the debug output, it shows that:

  • Recommended_quantity = 0

  • Recommended_quantity_price = 0

This suggests that the tiered pricing logic is not being applied at all in this context.

Does anyone have an idea on how to fix this issue?

Thanks in advance!


Kind regards, 

Wilfred Polderman

data.png

Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Wilfred,
it looks like you are trying to set the product field values from the Live integration ERP response xml.
In the Live integration settings there is an option called "Include product custom fields in request" so once it is activated the product custom fields will be sent in the Live integration request xml to the ERP, then in the Live integration response handling the values of those xml fields will be populated back into the matching product custom fields values. You can try to match the ERP response custom fields names with the Dynamicweb custom product fields system names in order that to work.

If that approach is not suitable then you can consider subscribing to the Live integration notification called:
Dynamicweb.Ecommerce.DynamicwebLiveIntegration.Notifications.OnAfterProductInfoProcessResponse
where you can parse the "response" xml field and store the fields values in the "productInfo" object and then in the other Live integration api call you can get the stored value by calling:
var infoProduct = Dynamicweb.Ecommerce.DynamicwebLiveIntegration.Products.ProductManager.GetProductInfo(product, settings, Pageview.User);

then you would need to propagate that infoProduct["Recommended_quantity"] custom field value in the relevant product.ProductFieldValues object or a template tag.

BR, Dmitrij

 
Wilfred Polderman
Reply

Hi Dmitriy, 

The problem has already been resolved. It turned out that i was not receiving the correct data, so the issue was outside of DW.

Thank you anyway for your assistance.

Kind regards,

Wilfred Polderman

 

You must be logged in to post in the forum