Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
I want to make a page in my admin panel to manage discounts by item type (folder). I'm not looking for discounts or promo codes, but automatically-applied discounts similar to how the Square app uses them. Ex: if a person buys two items in Category A, they get $5 off. If they buy two items from Category B, they get $2 off.

I've seen ways to set up sliding scales for prices, but they appear to be either cart-level (category doesn't matter) or item-level (buy two of the same item, get discount).

My ideal solution would be to have an admin panel page that grabs the list of folders and lets me adjust the discounts from there. The cart would check to see if the discounts apply and update accordingly. Making the page for the discounts seems straightforward enough, but how would I make the cart apply them?

As mentioned in the docs, Couch doesn't do anything out-of-the-box when it comes to calculating discounts, shipping charges etc - it requires some amount of PHP code in cart_ex.php. In fact, the discounts you mentioned are all just samples covering some common use-cases.

If you happen to be conversant with PHP (or can get someone who is), the function is pre_calc() in cart_ex.php. The sample has calculations for item level and cart level but can be easily modified to factor in any other condition (the folders, in your case).
The code, BTW, is profusely commented to help anyone trying to tweak it.

Hope this helps.
2 posts Page 1 of 1