Posted by justageek on November 3, 2008 at 9:12pm
| Project: | UC Discounts |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
I set up a basic multi-product discount, with quantity > 3 as the condition, the action should be a 10% discount, and the overall discount settings tell UC to apply the discount when product is added to the cart.
No matter what I do, I can't get the discount to apply.
I am using Acquia drupal 6 and the UC dev package
Comments
#1
I am having this same issue on Drupal 5. Is there anything special that needs to be done to get this working?
#2
I can't get multi-product discount to work either on a drupal 6 system and have tried quite a few approaches.
I also attempted applying a partially relevant patch for v5 - see #324083: Multi-Products Condition - and this did help to improve the display of the discount conditions and actions in the Store Configuration area but did not help to actually have the discount applied at the checkout.
#3
It works quite alright for me. Just as long as you don't change the "Stage at which to apply discounts".
After you set it to "When a product is added to the cart" setting, you get warning on all pages:
warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/uber2multi/sites/all/modules/uc_discounts/uc_discounts.module on line 312.
I looked at the code. There is $node->discounts property as if discounts are being added to the $node object but I don't see if it ever gets any value.
#4
Having similar problems to justageek (also D6/UC2). One wrinkle: I had it working until yesterday. I added attributes to the mix at that time, and now, no matter what I do, it doesn't work. Also can't get any other discounts to work, at all.
The config screens are kind of opaque and there are a few where you're asked to select an option that doesn't appear to do anything. That makes me nervous, so I've taken to simply deleting the Conditions and Actions, instead of trying to edit them. Doesn't seem to help, but it makes me fel as though I'm isolating the trials a bit more.
#5
I don't believe attributes are supported in UC Discounts module at all.
What are you referring to?
#6
I guess I don't understand your question. Attributes are a feature of Ubercart. I added attributes to my product. Do you mean that uc_discounts doesn't support applying discounts based on the total number of instances of a product in the same cart, if those instances have been rendered 'unique' by virtue of their attributes? That seems to me to be what I learned.
However, that's beside the point: After learning that, I went back and re-examined behavior of the comparison operators, and found that even with no attributes the only one I could get to work at all was less-than, and that it didn't work reliably.
#7
Subscribe
#8
Subscribe
#9
After reviewing the code for multi-products and going through it for my own purposes, I wrote a patch to fix two things. First of all, I've set it up so that the discounts for a mutli-product will display on the admin/store/discounts/% page.
The information for the discount is stored as a serialized array, and it looks like the person who developed this module never had a chance to test this feature out. Anyways, when the content is displayed in the view, this patch will unserialize the content and display it as an unordered list with a link to the nodes.
Also, the problem with the serialized content is also to blame for the discount not working on cart/checkout.
A slightly different method had to be written to figure out if the discount should be applied. Instead of it checking the quantity of the product, I used a count to see if the conditions have been met, and if the count of accepted conditions met the number of conditions to meet, then the discount is applied.
I performed a bit of testing on my machine, and it works for my needs, but might not be perfect in every situation. I commented the code in this section, in case anyone else decides to fix it up for a situation that breaks and I have not foreseen.
Hopefully this helps out those in need.