vrstudio Posted January 31, 2011 Share Posted January 31, 2011 Hey guys, I got a tough one. I've been researching for days, weeks even, to try and solve this. And I'm sure I'm going to kick myself if/when I get a solution. I've set up an ecommerce website from scratch (no prestashop, oscommerce, none of that), and I need to figure out how to decrease price on quantity. Ex; Umbrellas are $12.00 a piece. If you order 2 dozen (24) Umbrellas, they are only $10.00 a piece. I can't seem to figure out a way to make it work.. I have set up in my database the following columns. p - base price ($12) p1 - price after first increment ($10) q1 - quantity of first break (24) p2 q2 p3 q3 Hit me with your best shot. Quote Link to comment https://forums.phpfreaks.com/topic/226270-custom-e-commerce-price-decrement/ Share on other sites More sharing options...
ManiacDan Posted January 31, 2011 Share Posted January 31, 2011 You want a beginning AND END increment, and you want this in its own table: item_id, start_increment, end_increment, price_per_unit That way you can say: SELECT item.item_id, item.name, price_per_unit FROM item JOIN item_pricing USING( item_id ) WHERE $quantity BETWEEN start_increment AND end_increment Ta-da. -Dan Quote Link to comment https://forums.phpfreaks.com/topic/226270-custom-e-commerce-price-decrement/#findComment-1168012 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.