Jump to content

Custom E-Commerce Price Decrement


vrstudio

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.