Developer forum

Forum » Development » How to transfer additional information from PriceProvider to order line?

How to transfer additional information from PriceProvider to order line?

Morten Bengtson
Reply

I need to transfer some additional information (PriceID) from a custom PriceProvider to the order line.

My first thought was to add this info to the PriceReference property on the instance of PriceCalculated that is returned by the PriceProvider.

However, this PriceReference is never stored on the orderline.

Is there another way to accomplish this?


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Morten

Seems like there is a bug in orderline.save, see dump...

 
Nicolai Høeg Pedersen
Reply

Oooops. Wrong button :-)

As you can see, it does not load the price reference again from the orderline. So I think it is saved and then overwritten right away...

Just made a fix. What version are you using?

Nicolai

Capture.JPG
 
Morten Bengtson
Reply

Thanks, Nicolai.

I'm using 8.4.1.18

There are two price references stored on the order line - OrderLinePriceCalculationReference and OrderLineUnitPriceCalculationReference.

And the same bug appears in both Fill methods - OrderLine.Fill(System.Data.DataRow dataRow) and OrderLine.Fill(System.Data.IDataRecord DataRecord)

I hope you caugth all the bugs :)

 
Nicolai Høeg Pedersen
Reply

Hi Morten

I caught it 6 places actually. Will merge it to 8.4.1 today and give you a pirate build of dynamicweb.dll to test.

Nicolai

 
Morten Bengtson
Reply

A build by an old prirate? Sounds great :)

 
Nicolai Høeg Pedersen
Reply

It is awesome. It is now in your mail box!

 
Morten Bengtson
Reply

It's not awesome, since it still doesn't work.

I have instead implemented a notification subscriber where I call the price provider and add the price id to a custom orderline field.

 
Morten Bengtson
Reply

Hi Nicolai,

Thanks for your help so far :)

It would be great if you could provide a working example of how to use this PriceReference to transfer info from PriceProvider to OrderLine, since I cannot make it work.

I found a workaround (maybe - needs more testing) by using multiple notification subscribers, but it is not the best solution.

 

 
Nicolai Høeg Pedersen
Reply

Hi Morten

I have people on the task. Will get back to you!

Nicolai

 
Jonas Krarup Dam
Reply
This post has been marked as an answer

Hi Morten,

I've found a fix, it will be in the next hotfix for 8.4.1 (and later).

I will let you know directly when this is ready.

Regards, Jonas

Votes for this answer: 1
 
Kristian Kirkholt
Reply

Hi Morten

The Problem regarding #15802 "Price reference not reloaded on orderline." has been resolved in version 8.4.1.20

You are able to find this build in the download section:

http://developer.dynamicweb-cms.com/downloads/dynamicweb-8.aspx

Please contact Dynamicweb Support if you need any additional help regarding this.

Kind Regards

Dynamicweb Support

Kristian Kirkholt

 

You must be logged in to post in the forum