I am using the price table to hit certain quantity based price points and most of time this is working very well. Thank you.

It would be useful if price points could have a rounding facility. So for example if 6 units at 20.84 = 125.04. Then round down to 125.00

Obviously Price Table module's simplicity is it's strength, so without getting complicated with rounding up and down, just round down to nearest full currency unit.

I suggest rounding down rather than up, as this will never result in somebody being overcharged based on the value of the unit price.

rounding-screenshot.png96.45 KBMrPaulDriver
Members fund testing for the Drupal project. Drupal Association Learn more


pcambra’s picture

Nice feature, do you think it makes sense to have this as a setting per price item? Maybe it would be better to add it as a setting of the price table instance (field instance level).

MrPaulDriver’s picture

I'm glad you like it :-)

And yes I think you are right. Your way would be much less cluttered and would suit my requirements just the same.

I sell exhibition booths and my pricing model is as follows:

1st unit = 100
2nd unit - 90
3rd unit = 80
Additional units = 70 each
- Therefore 4 units = 340

This model still works with a price table, but is not strictly by price per unit. It is however a fairly common way of providing quantity discounts and is very easy to explain to people.

I had looked at the underlying rule, but couldn't figure out how to change it. I'm sure I'm not alone so a settings option would be most appreciated.

Suggest a simple checkbox.
Title: Enable Price Rounding
Help Text: Will round down the line item total to the nearest whole currency unit. Useful for some quantity discount pricing models.

To finish it off, you could provide a second checkbox for 'Hide unit price in shopping cart'. I say this because one might prefer not to display the price table because it shows unit prices, yet they do appear in the shopping cart. One could hide this via css but it occurs to me that this might effect non-price table cart items?

pcambra’s picture

Status: Active » Closed (works as designed)

Gave this a second thought.

The way that commerce manage pricing uses a "minor unit" approach, storing amounts as integers meaning that currencies such as € and $ are stored as 3000 and the currency has information about printing it with 2 decimals: 30.00€ i.e. What this means in the practice is that rounding is not effective as you could imagine it, and can't be a property of the field, but some rule applied to the final price.

My suggestion is that you could implement some set of rules that take care of the prices you want to alter and round them in the custom way you want.

MrPaulDriver’s picture

Hmm. I don't really understand, but don't doubt what you say.

Do you have time to explain how to build such a rule?

Perhaps there is a case for a separate module, it is after all a fairly common pricing model.