17 replies [Last post]
jsims281's picture
Offline
Joined: 05/28/2009
Juice: 69
Was this information Helpful?

I'm developing a module to handle discounting products in bulk, for example "all products in category x have a 20% discount on the selling price". Mainly for the sites I develop but also for the good of the community!

What features would you like in such a module, and what would you expect a module such as this to deliver? Thinking inside and outside the box is welcome!

TR
TR's picture
Online
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3269
Since you asked ...

Since you asked ...

I would strongly prefer and suggest that instead of writing your own solution from scratch you spend your time and effort to enhance and improve the existing discount module(s). Maybe read up on the modules currently in use and see what work is being done towards unifying and improving Ubercart discount mechanisms, then contribute to that end. I don't think it benefits the community at all to have everyone working on his or her own private implementation.

<tr>.
jsims281's picture
Offline
Joined: 05/28/2009
Juice: 69
Not ideal because...

Thanks for the reply, I totally appreciate what you are saying Smiling

But, I've not been able to find any modules that offer up this functionality with the level of simplicity (for the end user) that I'd like.

In the words of a non-tech-savvy client: "I want to be able to just click and make all the products in whatever section discounted by, say, 20%. Then a week later, put them back to full price".

The discounting I've found tends to be site-wide, and based on "spend x amount for a discount on your order total", or "enter a code and get a discount on your order total".

I've found
uc_discounts at http://www.ubercart.org/contrib/143 , which is due to be depreciated by...
uc_discount at http://drupal.org/project/uc_discount , which seems to be concerned with site-wide discounts

there is also
http://drupal.org/project/uc_coupon which is fantastic for what it does, but does not seem to lend itself to what I need (i.e. no coupon codes).

Are there any I have missed out here, or is there some functionality I have overlooked in the modules I've mentioned above?

Are there any forum posts I may have missed that you could recommend to me?

People appear to be finding their own solutions to this problem from what I can see anyway
http://www.ubercart.org/forum/support/4268/uc_discount_module_why_no_con...
http://www.ubercart.org/forum/support/13832/sale_special_offers
http://www.ubercart.org/forum/support/11569/sale_special_offers

edit: http://drupal.org/project/uc_discounts_alt this seems to be a good module for me to look into

stephthegeek's picture
Offline
Theminator
Joined: 10/20/2007
Juice: 575
Re: Not ideal because...

UC Discounts Alt is quite feature-rich, supports coupon codes, and is working well for us for some complex use cases, such as purchasing one item getting you a discount on other products of a certain class. I don't think it supports anything that expires (ie. the "put all these items on sale for a week" part) so that sounds like an excellent extension of the module. Or perhaps Flag integration would be another welcome addition, for easy one-click flagging of on sale products.

I'm excited to hear that you'll be contributing, but echo what TR said -- building on existing modules is strongly preferred. Glad that you posted here so we can have a discussion like this and help to consolidate efforts Smiling

Gorgeous original Drupal themes (and Ubercart themes!) ~ Psst: more Ubercart themes on our new site

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15459
jsims281 wrote: uc_discount
jsims281 wrote:

uc_discount at http://drupal.org/project/uc_discount , which seems to be concerned with site-wide discounts

Actually, this can quite easily handle per-product discounts. It's based on Conditional Actions, so you can setup whatever conditions you need to make sure the discount is only applied when necessary. In other words, you can add a condition to check the category and a condition to check the date, and if those conditions aren't met for the product then the discount action won't be applied. It works through CA, so the UI isn't crazy simple like you're wanting, but the functionality is there. Perhaps you can simply add a simplistic UI layer on top of it.

jsims281's picture
Offline
Joined: 05/28/2009
Juice: 69
OK
Quote:

the UI isn't crazy simple like you're wanting, but the functionality is there. Perhaps you can simply add a simplistic UI layer on top of it.

That's another one of the problems, if I tried to explain to him how to set up CA's, his face would quickly turn an un-natural colour.

Making a UI for uc_discount or it's alt though, is definately something I will look at in the future. It seems to be the best way to get all the features through and help the biggest amount of people. Smiling

Considering that the functions I want are pretty simple, and that I've already made my module to my requirements (i.e. you can edit the sell price of a whole taxonomy term of products by a percentage amount, and then restore it to the original later) I'll stick with it, but based on TR's advice, I will not release the module to the site.

stephthegeek's picture
Offline
Theminator
Joined: 10/20/2007
Juice: 575
Re: OK

Also one major benefit of collaboration beyond helping other people is helping yourself -- by contributing code to another existing module, you're not the only one responsible for maintaining it going forward Eye-wink

Gorgeous original Drupal themes (and Ubercart themes!) ~ Psst: more Ubercart themes on our new site

digitalfrontiersmedia's picture
Offline
Getting busy with the Ubercode.
Joined: 11/08/2008
Juice: 283
Re: OK

If the module indeed has unique benefits, I'd suggest at least offering it up if you yourself don't have the time to integrate it into an existing module, perhaps someone else will. It's hard to say what combinations of code someone might find useful to their particular application.

I was just speaking on the phone about this very issue this morning. While Ryan's suggestion is correct, if you have 1200 products with a good number of them having individual product discounts that are all different, setting something like that up through CA isn't really a workable solution for the average client. Something like what you suggest would be useful to start from.

I'm interested. Smiling

TR
TR's picture
Online
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3269
Re: jsims281 wrote: uc_discount

From your description in #2,

jsims281 wrote:

"I want to be able to just click and make all the products in whatever section discounted by, say, 20%. Then a week later, put them back to full price".

it sounds like you're really talking about an "On Sale" module, not a discounts module per se. I think an "On Sale" module would be useful, and there are quite a few threads (including code fragments) that discuss how this can be done. Demonstrating that feature with a standalone module is the first step towards getting it implemented in core.

<tr>.
jsims281's picture
Offline
Joined: 05/28/2009
Juice: 69
Thanks

Well, in that case I'll tidy it up a bit over the weekend and post it onto this thread so you can see what you think. It's a very basic interface at the moment but the guts of it are there.

@TR Yes, it *is* more of an "on sale" module, you're right.

Thanks all, for the interest and advice Smiling

jsims281's picture
Offline
Joined: 05/28/2009
Juice: 69
Here it is

Apologies for how smelly this code is at the moment...but I said I'd put it up so here it is! I'm tidying it up when I get time here and there, but this is working (I hope) so feel free to have a look and see what you think.

Also I started off using if: endif; structure then realised that is totally out of whack with the drupal standards...so as you see it here, it's halfway through being made consistent with this spec: http://drupal.org/coding-standards.

The worst part is I couldn't get the function that is called when the form gets submitted working...if I could work it, there would be a lot of junk I could cut out right away.

//not sure why this isn't working, so do it manually
//function uc_bulkdiscount_admin_submit($form, &$form_state) {
function bulkdiscount_update() {

Please don't use this on a development site, just in case it deletes all your data and sets your server on fire.

P.S. I just noticed only discount 1 is being validated too. So if you're trying to break it please bear that in mind.

AttachmentSize
uc_bulkdiscount.zip 4.08 KB
zeezhao's picture
Offline
Joined: 04/23/2008
Juice: 1075
Re: Here it is

subscribing

paragkenia's picture
Offline
Joined: 06/16/2009
Juice: 4
Discount to Customer Group

Is there any discount module where discount can be configured for certain group of customers say wholesale group, retail group etc... and inside group different slot for different categories or per product?

escoles@drupal.org's picture
Offline
Joined: 01/14/2009
Juice: 78
Re: New discounts module, tell me the features YOU want

Since you're asking what we'd want:

I would want a discount module that did not require me to configure Conditional Actions.

I'm trying to set up a simple bulk discount right now with UC_Discounts, and I can't figure out how to even get the thing to fire. Or for that matter, what makes any Conditional Action fire. So far I haven't managed to set a trigger that actually ever gets pulled. Because there's not much documentation, what I'm going to have to do is create a new CA for every trigger to deliver messages, and go through and figure out by process of elimination which ones fire when.

I see no clear documentation on how to make discounts work via Conditional Actions. For that matter, the idea of Conditional Actions as the driver is pretty opaque. I only went there because I did a bunch of work with Ubercart 6 or 8 months back and I finally figured out that's where you go.

I think it's probably a mistake to try to do all discounts with the same module, at least from a UI perspective. As a user -- as a person entering new products -- the idea that I have to define new logic using an arcane process every time I want to assign a new and ordinary type of discount, is very daunting.

mad-joe's picture
Offline
Joined: 12/20/2009
Juice: 45
jsims281 wrote: What
jsims281 wrote:

What features would you like in such a module, and what would you expect a module such as this to deliver? Thinking inside and outside the box is welcome!

I've noticed a new module http://drupal.org/project/uc_bulk_discount - even if there is a module http://drupal.org/project/uc_discount which is bigger and gives us more freedom, combining these two modules could be fantastic for setting discounts as follows:

PRODUCT PAGE (DISCOUNT tab)
- select multiple users (or roles) to set the discount of a different values
- example: John, Mary and Kate have 20% discount for this product and guys from Microsoft (role) have only 5% discount.

USER PROFILE PAGE (DISCOUNT tab)
- select multiple products (or product groups) to set the discount of a different values
- example: John has 20% discount for shoes and 30% discount for all clothing in the store, etc.

"Product groups" could be a selectable items of a given taxonomy. Is there any better approach for grouping products and applying discounts? If not, products should be tagged with different taxonomies, for example: one taxonomy that will be used for catalog, and the other taxonomy that could be used for setting discounts.

This approach could be very useful and user friendly. What do you think?

cookiesunshinex's picture
Offline
Joined: 10/14/2009
Juice: 127
Subscribing. Also want to

Subscribing.

Also want to pipe up that combining code to existing module wherever possible is the best approach.

There is nothing more frustrating or time consuming than to build a new drupal site and the client requires a functionality that you haven't had to build before and find out that - to perfrom that task - there are 7 modules that do roughly the same thing.

I certainly appreciate your zest and energy towards creating something instead of asking for someone else to do it!!!

Lasbrey's picture
Offline
Joined: 02/21/2010
Juice: 9
+/- price adjustments

I am sorry I am joining the discussion late, but Is it possible to make a module to handle +/- price adjustments with userfriendly UI? So that the administrator can then enter +20% or -20%.

Bruiseviolet's picture
Offline
Joined: 10/22/2010
Juice: 232
Re: New discounts module, tell me the features YOU want

I would love a module where we could go a buy 2 get 1 free coupon. IE- costumer buys 2 of any product and gets a 3rd product free. So in the checkout the coupon code would automatically show that the least expensive item was FREE- I really dread doing EVERYTHING with conditional actions- as this one store already has a gazillion conditional actions and it's rather messy and cumbersome. I would ,love a simple coupon module for this that we could quickly turn off and on- as this site does a different coupon / product special every month for their users. They also run different specials for retail vs. wholesale customers as well.

Really really would like a BOGO coupon! Everything so far is just "take a certain amount off" or "take a certain percentage off". This doesn't work- as their products have a large price range.

Mom. Entrepreneur. Awesome. www.frequencyapps.com