Guest Posted December 12, 2002 Share Posted December 12, 2002 Hi! I'm working on a contribution which will allow for a per-department style of discount (ie, 10% off this week in manchester, 25% in electronics, etc.). It will also enable these discounts to work for specific customers or not (that's global at the moment, so you won't be able to have Customer A only get their discount in manchester, and Customer B in Electronics only... but I digress) I've managed to get around 90% of the work done by using as templates the product_attributes, and creating a new table plus extending customer and products. However, I'm kind of 'stuck' at one point. I don't want a logged in user to see a regular price AND the disccounted price, just the discounted price. However, where to put this? The call to currency->display_price seems to be around the most sensible place to put the logic to subtract the discount. However, this routine has now knowledge of the product_id or the customer_id, both of which are vital to apply and calculate the percentage (if applicable). I'd appreciate suggestions as to where this extra code (the actual calculation) should go. I'm half of a mind to modify the display_price routine to accept a product_id and customer_id field, but that's obviously going to require re-writing each call of that function. So, before I completely break everything here, I'd appreciate anyone's thoughts. CHeers, Pete. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.