Closed (fixed)
Project:
Ubercart Discounts (Alternative)
Version:
6.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Dec 2010 at 07:12 UTC
Updated:
28 Sep 2011 at 18:21 UTC
Comments
Comment #1
ergophobe commentedI forgot to mention, this was original requested in #448624: Qualification based on products (list of SKUs), Single Product but it seemed better to open a new feature request for it
Comment #2
ergophobe commentedRyan - I looked at the code. It doesn't look like this would be that complicated (famous last words), just a bit tedious, but it will probably take me a couple of weeks to get to it... but I do hope to create a patch for this pretty soon.
For the minimum, it would require one additional table (uc_discounts_required_products). For the ultimate, several (uc_discounts_required_classes, etc) and quite changing lots of queries.
Comment #3
ryangroe commentedShould be one more join and an IN statement, right? Ultimately it's more a matter of making sure all the code paths work rather than getting the concept to work.
Give a patch and shot and I, daveoxide or jrust will integrate. Thanks for your help!
Comment #4
ergophobe commentedCool. It will take a few weeks what with current projects and various holiday stuff. Since I seem to be the only one who wants it, I figure there's no hurry.
If you guys weren't interested in folding in a patch like this (assuming it works well), I just didn't want to end up with a fork.
Comment #5
jrust commentedSounds like we need Rules integration, but I don't think that's gonna happen anytime soon.
Comment #6
ergophobe commentedhmmm... can ask a possibly foolish question? What do you imagine the "event" (or events) would be that would trigger the rules. Add to cart? View cart????
Just confessing total ignorance here - I understand the *concept* of the Rules module, but close to nothing about it from a developer's perspective.
Comment #7
jrust commentedYeah, good point, I don't think rules would work. It would just be nice if we had rules' flexible interface for making conditions. Did you make any headway on it?
Comment #8
ergophobe commentedSorry... no, I got sidetracked and had to do some sort of ugly hardcoded hacks to get the site launched by deadline, but finally it seems most of the fires are out and I'm getting some time to cycle back around and do things "right". I'll put this back on the list!
Comment #9
xpersonas commentedsubscribe
Comment #10
leevh commentedsubscribe
Comment #11
jrust commentedAdded in dev.
Comment #12
mattcasey commentedI have two issues with the dev:
1. when I select Filter by Terms, it incorrectly includes the full list from "Filter by Products" plus the Term list tacked on at the end.
2. when I save the discount, it reloads the form but no products are selected for either Required Products or Discounted Products. If I just hit "Submit" again, I get the error "At least one product must be selected." with both fields red.
Comment #13
jrust commentedHmm, I don't have any ideas as it's working on my end. If you're able to debug further that would be helpful.
Comment #14
mattcasey commentedThe fields are now being saved, I had to run update.php and there were a number of updates to the uc_discount.module, using UC 2.6. I still see the full list of products with the list of terms, but that's not as much of an issue. I will try to debug it more
Comment #15
mattcasey commentedIt looks like $options needs to be reset when creating the list of terms in uc_discounts.admin.inc. This is how the other lists are set up. This fix works for me, starting at line 472:
Comment #16
jrust commentedSweet, pushed the fix.