5 replies [Last post]
frost's picture
Offline
Joined: 07/23/2008
Juice: 134
Was this information Helpful?

I've described what I'm looking in the uc_discount_framework issue queue (http://drupal.org/node/924362) but that module is so buggy I've decided not to try getting it to do what I want.

Functionality:
Basically we need a discount to be applied at order level (as a line item) when the user checking out has the "Member" role. The single line item should be called "Member discount", and should be the sum of 10% of each product in the shopping cart EXCEPT those products that are in a few excluded product classes (Vouchers, Membership & Donations). Note that the product prices in the order should NOT be changed, we want the full product prices to appear for each product. The order total should of course reflect the 10% discount, and the discounted total needs to be used with Paypal and Realex payments, system reports, and of course if anyone views the order after it has been completed, they should still see the same discount and total etc. If there is no discount (ie the person isn't a member or he is only buying excluded products) then no line item should appear at all.
Nice to have, but not strictly necessary, would be an order comment added when the discount is applied, that just says something simple like "Members 10% of €123.45 applied.

Note:
The discount line item and order total will have to be recomputed if the user starts checking out but doesn't complete the chcekout process and then goes back to check out later. This is because they might have modified the order (added/removed products, quantities) or their membership status might have changed etc. However, when viewing an order that has already been checkd out, it would be a mistake to recompute the discount, since at that stage the order can't be modified.

Code requirements:
The code for this should be in a custom module, and it can be hard coded (if it ever changes I'll just change the code myself). So no configuration, parameters, or UI needed, just quick & dirty code.
Documentation: The only thing I ask is that you put some useful comments in the code so I can understand what you're doing. I'm a programmer so you can assume I understand PHP, but a few explanations about the hooks, API calls etc that you use will be appreciated.
The role name, the line item text, the percentage discount and the excluded classes can all be hard coded. I know it's ugly but it will be be so much easier than wading through the discount framework code!

I'll pay USD$50 via Paypal for this. It's needed asap.

longwave's picture
Offline
Joined: 09/20/2008
Juice: 487
Re: Need a order discount set up - hard coded into a module

I think http://drupal.org/project/uc_discounts_alt can do all this fairly easily already, with a full UI to boot.

--
These forums are for general support questions about Ubercart.
Bug reports and feature requests should be posted at http://drupal.org/project/issues/ubercart
Latest API documentation can be found at http://api.ubercart.me/

frost's picture
Offline
Joined: 07/23/2008
Juice: 134
Re: Re: Need a order discount set up - hard coded into a module

thanks for that longwave. i think i looked at that a while back and the issues in the queue looked serious. have you used it recently & any sense of how stable it is these days?

Jay Matwichuk's picture
Offline
Joined: 02/15/2010
Juice: 171
Re: Re: Re: Need a order discount set up - hard coded into a mod

Even though uc_discounts_alt is still in dev, it works pretty good. I have had an issue or two with it in the past (it wouldn't apply a discount no matter what I did at one point), for the most part things like that don't happen.

frost's picture
Offline
Joined: 07/23/2008
Juice: 134
Re: Re: Re: Re: Need a order discount set up - hard coded into a

ok i'll give it a go. my hesitation is because i had been using a 5.x version of a discount module (from the contrib area of ubercart.org) which required a LOT of recoding to do what it was supposed to do. when i moved to 6.x i had to drop that module as recoding for 6.x was just too scary
anyway i'll try the uc_discounts_alt module and see how it goes...

frost's picture
Offline
Joined: 07/23/2008
Juice: 134
it works!

thanks very much for that, uc_discounts_alt is doing exactly what i want!