Last active
August 29, 2015 14:00
-
-
Save thadallender/11051590 to your computer and use it in GitHub Desktop.
Volume discounts for Sell Media. Please note: Sell Media verifies the total cost of items from the database right before sending the order to the payment gateway. Comment out lines 200-232 in sell-media/sell-media.js to disable server-side price verification.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sellMediaCart.total = function(){ | |
| var total = 0; | |
| sellMediaCart.each(function (item) { | |
| total += item.total(); | |
| }); | |
| // take 10 off it qty is greater than or equal to 5 | |
| if ( sellMediaCart.quantity() >= 5 ){ | |
| total -= 10; | |
| // take 4 off it qty is greater than or equal to 3 | |
| } else if ( sellMediaCart.quantity() >= 3 ){ | |
| total -= 4; | |
| // otherwise, no discount | |
| } else { | |
| total -= 0; | |
| } | |
| return total; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment