I have a client who is requesting that a customer be given a discount based on the total number of products they buy. Every time they buy something it is added to their total bought and once that total bought reaches a certain level, they are given a discount.

CommentFileSizeAuthor
#2 volumediscounts.txt4.82 KBlonehorseend

Comments

ezra-g’s picture

Interesting feature. Patches welcome!

lonehorseend’s picture

StatusFileSize
new4.82 KB

Here you go! I also made changes to the how the discount is displayed in the cart. That part is optional and looked better on my website. Other than that, this patch looks at a customer's previous orders and totals them with the current order to determine if they qualify the discount.

One thing that needs to be addressed is the status. Right now, it is hard coded to accept only completed orders in order to calculate the customer's previous orders, but I think it should be able to be set by the admin.

ezra-g’s picture

Status: Active » Needs review

Marking as NR.