MarketPress Discount % To Members

Any way to build in a discount on a purchase based off of the logged in members role? Lets say user 1 is a subscriber, and user 2 is an Author. User 1 pays 100% of total, User 2 pays 80% of total?

If not, which php file - where in the plugin contains the code to handle discounts? Seems easy enough to interject a check of there membership and hard code in a discount.

Im not really looking for coupon codes because it needs to be automated, unless i can automate a single sitewide coupon to be emailed out to a user??

  • DavidM

    Hi bigt11,

    That sounds like a neat idea, a user role based discount. The Membership plugin could easily take advantage of that with its user role integration too. You could perhaps post a request on this in the feature suggestion forum.

    As for the code, there's not a "single" place in the code where discounts are figured in. Coupon codes are requested during checkout and figured into the payment process via the payment gateways.

    What you could do is alter one of the gateways to account for a discount. All the gateways are neatly commented and exist in the following folder:

    The thing is, you'd likely want to inform members of discounts in the cart process and perhaps elsewhere. The cart code would have to be altered though, through the internal _mp_cart_table() function, likely around line 231 of marketpress\marketpress-includes\template-functions.php.

    It gets a bit technical, but if you post a request and enough other members voice support for it, perhaps that could be built right into the plugin.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.