Hi,

If you are trying to set overridden_unit_price field to TRUE before the order if finished, overridden_unit_price will get set back to 0. Reason for this is that method setUnitPrice() has a second argument ($override) set by default to FALSE. Meaning that all later calls to setUnitPrice() with just a first argument ($unit_price) will set overridden_unit_price to FALSE no matter what.

CommentFileSizeAuthor
#2 2954000-1.patch744 bytesqstraza

Comments

qstraza created an issue. See original summary.

qstraza’s picture

StatusFileSize
new744 bytes
agoradesign’s picture

Status: Active » Needs work
Issue tags: +Needs tests

Just a formal reason to set the issue to "needs" work: you forgot to adjust the parameter as well in the OrderItemInterface + perhaps a small comment there, what it means to leave the paramter NULL. And as always, especially with bug reports: we need tests

Imho the proposal makes sense, but this has to be decided by bojanz.

mglaman’s picture

Yes, we need a test which confirms the scenario, and then proves the fix.

bojanz’s picture

Status: Needs work » Closed (duplicate)

Let's continue in #2907808: The original overridden unit price is lost on subsequent order refreshes, my #15 explains what needs to happen (adding a new field to avoid data loss).