Sorry if this has been posted, I did try to search as best I could...

I'm having a problem trying to discount some prices by half for a promotion on my site using payments >> adjustments. For my two sample items, the prices are $5,000 and $3,000. Once the re-calculated price reaches $1,000 it gets screwed up. So, I could put in 30% and the 5k item shows up as $1.00, but the 3k item is calculated properly as $900. If I increase the discount to 40%, my products now show up with prices of $2.00 and $1.00.

Any advice, workaround, or other help would be greatly appreciated!

CommentFileSizeAuthor
#1 payment.patch.txt627 byteswpd

Comments

wpd’s picture

Version: » 4.6.x-1.x-dev
Component: 0 » payment.module
Category: 0 » bug
Status: Active » Needs review
StatusFileSize
new627 bytes

I can reproduce this in HEAD also. The problem is that number_format is called twice. It only shows up on values greater than 1,000. The comma is inserted into the first call to number_format and that screws up the result for the second call.

This patch removes the first call. There is still a call to round. We may want to think about, but I think we may need to remove all the round calls to display level. If you round at every adjustment you can end up woth incorrect results.

wpd’s picture

My patch is for head. It is a one line fix, so it should be trivial to make the change for 4.6 also.

irishsuperfly’s picture

Thank you so much for the help (and quick reply)! I made the change to payment.module and it works perfectly.

wpd’s picture

Version: 4.6.x-1.x-dev » master
Status: Needs review » Reviewed & tested by the community

Changing settings based on irishsuperfly testing

gordon’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, Committed to cvs.

wpd’s picture

Status: Fixed » Closed (fixed)