The attached patch introduces five changes to the original commerce_price_table module:
- The field used in the price calculation rule is now selected as a parameter of type 'list' using 'commerce-line-item:commerce-product:field-price-table' as default value. This change adds the ability to combine the price calculation with additional conditions. For example, you can add a second price table that will be used only if the user belongs to a special role, like wholesalers.
- The field 'max_qty' is removed. Instead, 'min_qty - 1' of the next higher item is used as the maximum value.
- Changed table formatting from 'X - Unlimited' into '≥ X'
- The validate function now ensures that there is at least one entry with min_qty = 0 and that each min_qty is unique.
- I moved min_qty above the amount field, because that feels better for me.
Important: This patch does NOT include an upgrade path, since I started a project from scratch and didn't need it. If this patch is merged, someone has to write an update that alters the field definition.