hem:
So this would be basing reward points as a percentage of the total price rather than applying a value directly to each product???
No not at all the points should be assignable individually. The class would be able to access the points for an individual product by passing in the product id.
However, the shop administrator should probably have the choice to award points to a product by both:
- A multiplier of price (calculated from the default currency).
- Individually assignable constant value.
The default value should probably be a globally fixed multiplier of price, then this could be overridden on a product by product basis.
My suggestion for the product_reward_points table would be to have 3 columns
- product_id: INT, PRIMARY KEY, NOT NULL
- points_type: SET{fixed, multiple, global}, NOT NULL
- value: FLOAT
If "global" is set then "value" is ignored. Although this will contain redundant data, it seems better than doing it the proper way (probably saves space too)
The default multiplier should be able to be set from the admin.