Closed (fixed)
Project:
Ubercart Discounts (Alternative)
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
29 Apr 2009 at 16:19 UTC
Updated:
2 May 2011 at 19:17 UTC
Jump to comment: Most recent file
Comments
Comment #1
adrianmak commentedUbercart Discounts (Alternative) can make discount by
1. individual product
2. by taxonomy term
3. by roles
In your case, you can select each individual product during create a discount or
create a special taxonomy term and assign those product into this term and apply discount by this term.
Hope this can help you
Comment #2
rusvid commentedUnfortunately, I don't see how this can help me.
Discount on the product should be applied, depending on whether there are certain products in the shopping cart or not.
For example (extended example from the first post):
There are three products: "Product A", "Product B", "Product C". "Product A" discount is given if the shopping cart contains a "Product B" and/or "Product C".
1. Customer adds "Product A" to the shopping cart.
2. Customer adds "Product B" to the shopping cart and receive a discount on the "Product A".
3. Customer adds "Product C" to the shopping cart.
4. Customer removes "Product B" from the shopping cart. Discount on the "Product A" is applied because the cart contains "Product C".
5. Customer removes "Product C" from the shopping cart and lost the discount on the "Product A".
I think this will work if I can set a list of SKUs (like a list of codes) and the discounts will be calculated on the basis of this list.
Comment #3
ryangroe commentedI can attempt to add a new filter type on top of products and terms. Let me see how tough this would be.
Comment #4
ryangroe commentedOK, the SKU filter type is done. It will be part of beta 31.
Comment #5
Sborsody commentedI'm not sure I'm understanding how to apply this kind of discount.
Here's a way of looking at this kind of purchase with discount.
Someone purchases a Kindle and they get to choose two free ebooks with that (free items). They can also purchase more ebooks with that order at a discounted price, up to 10 max. Naturally, they can purchase more ebooks at their regular price.
The qualifying product is the Kindle. As long as there is a Kindle in the cart, they can pick up to 10 ebooks, two of which are free and the rest are discounted. What is throwing me off is the form for adding discounts. How do I say there's two free ebooks if a Kindle is in the cart?
Comment #6
Sborsody commentedIt seems like what needs to take place is an expansion of the operational logic of this module to increase flexibility. Right now there's the "filter" idea which seems to equivocate between both conditions of qualification and what the discount applies to. These perhaps need to be separated. The discount edit form can have different sections grouped together something like so:
- Discount rule information
(name, description, admin description)
- Cart Qualifications with AND/OR conditions
- Discount
Also put all the "max" settings together with their appropriate parents.
Comment #7
Sborsody commentedHere's a patch against beta33 of uc_discounts.admin.inc just to change around the form. I also corrected some #description problems. I haven't changed or added any new functionality.. yet. There's the checkbox "Require single product to qualify." (whose functionality probably needs slight changing) and under this should be where one can specify the product so I added a placeholder textfield for now. The discount does not apply to this product. It is only a condition for qualification.
Comment #8
ryangroe commentedThanks, Sborsody. I started work on this but I haven't had any time to work on the module in a month. Unfortunately I won't be able to work on it again for 2-3 weeks still. I'll address all your questions as soon as I can.
Comment #9
Sborsody commentedCool. I'm doing some more work on this (can't really wait 2-3 weeks). I'll post what I got later.
Comment #10
Sborsody commentedHere's what I've done against beta33. Running update.php is required.
Seems to work. :)
My test discount case is "minimum quantity", quantity amount = 2, filter by sku (around 27 product selected), and required single product checked with a required product (by sku) selected that isn't selected in the "filter by" list.
Comment #11
Sborsody commentedFor whatever reason, my patch seems to prevent other discounts from being applied... trying again.
Comment #12
IT Guy 3000 commentedGlad to see some continued interest in this module, Sborsody, which I'm using alongside UC Discount Framework, which uses conditional actions to accomplish some things. Would be great to only use (alt), and the "require single product to qualify" idea would be great. At the moment I'm trying to add a role-based discount to certain cart items if the role is being purchased at the same time. So checking to see if a certain SKU, for instance, is in the cart, and if so, apply an existing role-based discount. Alternately, and more generally, is it already possible to create a discount in (alt) for a set of SKUs when another certain SKU is in the cart? I'm on beta33.
Thanks for any advice. And thanks for the great work on this, ryangroe. Discount modeling can be, and has been, headache-inducing :) I have some other feature ideas that I'll post separately.
Cheers,
ITG3000
Comment #13
Sborsody commentedHere's a new version against beta33.
This version accomplishes two things
1) Adds Filter by product class
2) Adds "required product" by SKU pull down list
The functionality of "requires single product" before my changes was that it required either a minimum price or minimum qty of a single product that was selected by the "Filter by" drop down. So what one could do was select two products in the "Filter by" dialog, check "requires single product" and set min price/qty as say 5. So it would check if in the cart there was 5 of one of the two product or $5 of one of the two product. Then the discount would be applied to both product. The difference is subtle.
With my change, the same thing can be done, but one would need to set "can be combined", select a single product in "required product", and then create another discount for the other product. In effect there would be two different discounts, one each for the two different products. This is how I'm going to be using it. Each discount has a name like "3 free items with product X purchase" and "2 free items with product Y purchase".
Imaginably it may not be desirable for some to create so many discounts. The "required product" pull down list could probably be converted to allow the selection of multiple product. Another option is to replicate the whole "filter by" selections in order to allow someone to create a discount like "if any of product class X is in cart, apply discount to any product class Y that is in cart". But then the "requires single product" function might be lost (i.e., you have to buy 5 of the same product to get the discount, not just 5 of multiple products).
Comment #14
Sborsody commentedIT Guy 3000,
You can't exactly do that on beta33 because SKUs listed in the discount are both order qualifiers and product that the discount gets applied to. So if you had another SKU in the cart that must be there for the order to qualify, it could also be discounted.
With the patch I made, you could copy your existing role-based discount then have the "role product" SKU selected as the "required product" and "by role" turned off. The "required product" is not selected for discounting if it isn't also listed in "filter by".
I agree this module is great and has a lot of potential going forward.
Comment #15
ezra-g commentedAfter applying this patch, role-based discounts for users who already have the role stopped working, and role-based discounts for users who would create an account and be granted a role as part of checkout also did not receive discounts. I tried checking " Require single product to qualify" and specifying a product but with no luck. I did run update.php.
Any suggestions, or does this need a re-roll?
Attached is a straight re-roll of the patches in #13 using the cvs diff -upR flags. The -R makes the patch recursive, so it includes multiple files in a single patch.
Comment #16
ezra-g commentedHmm, after rolling back this patch and the database, we still don't have discounts working. This might be caused by something else. Setting back to needs review.
Comment #17
Sborsody commentedDid you figure out your role-based discount issue?
Comment #18
ezra-g commentedI think we were having an unrelated problem and managed to clear it up.
Unfortunately, this patch no-longer applies and needs to be re-rolled. I'd love to commit this to the 6.x-2.x branch :).
Bumping version # and marking as needs work.
Comment #19
Sborsody commentedI'll do it later. I need to make two separate patches anyway. One is for filtering product by class and the other is this. Right now I'm running beta-36.
Comment #20
OsterD commentedPlease have a look on this partially related issue.
http://drupal.org/node/566514
Thanks.
Comment #21
ezra-g commentedHere's a re-roll that was done in part by committing to an older version of uc_discounts_alt and then running coder_format, then diffing against the 6-2 branch, then diffing that against cvs.
Comment #22
ezra-g commentedHere's a re-roll that clears up some syntax errors and fixes the discount form so that the discount amount is saved. It seems likely we'll find more bugs due before this is RTBC. We should also go back and verify that anything committed since August 4th is not disturbed by this reroll.
Comment #23
ezra-g commentedThis re-roll removes a call to fprint and restores compatibility with percentage off per qualifying product.
Comment #24
ezra-g commentedThe hunks that failed here are because #587270: Percentage off per qual. product calculates discount incorrectly has already been committed.
This patch is now committed -- We'll get some testing in the next release.
Thanks!
Comment #26
steveoliver commentedSborsody, In your last paragraph you wrote
This is exactly what I would like to do. How can this be done?
Thanks,
-Steve
Comment #27
Sborsody commentedWhich is exactly what you would like to do? There's two different options up there.
Comment #28
steveoliver commented"required product" pull down list could probably be converted to allow the selection of multiple product(s).
Comment #29
Poieo commented+1 to see require a single product, class, or term to qualify for a discount.
This would give you the ability to discount all 'widgets' if any 'widget' is in your cart.