# Calculate rebate in a web shop

**URL:** <https://www.ruby-forum.com/t/calculate-rebate-in-a-web-shop/178907>\
**Category:** Deployment\
**Created:** [November 13, 2009, 11:14am UTC](https://www.ruby-forum.com/t/calculate-rebate-in-a-web-shop/178907 "2009-11-13T11:14:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [November 13, 2009, 11:14am UTC](https://www.ruby-forum.com/t/calculate-rebate-in-a-web-shop/178907/1 "2009-11-13T11:14:59Z")

</div>

My 2 brain cells have difficulties with this problem.

I’m creating a web shop where each item has a price. If you buy 3 you  
get a lower price for each item and then even lower when you buy 6.

Each item in the product table has a unique product id and three columns  
for prices; price, price3 and price6.

How should I do this? I guess one way would just to count each and see  
if it’s dividable by 3 or 6 and then the magic comes … but not sure  
this is the right way. Any ideas? I’m I on the right path?
