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
https://forums.phpfreaks.com/topic/226270-custom-e-commerce-price-decrement/
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.