We have a video product with several attributes, two with price adjustments on them. With RC1 we noticed that the price adjustments display fine on the product and once in the cart, the price is still there, but once you go to checkout the adjustments are stripped and only the base price is displayed and totaled. I started the upgrade to RC2 locally, hoping to fix it, but that is worse. In RC2 the adjustment is still displayed on the product, but if added to the cart, only the base price shows (and obviously this "reduced" price sticks with it through checkout).
We are using core Ubercart, and we also have the uc_discount (HEAD) and uc_node_checkout (6.x-2.0-beta3) enabled, but not in use for this product.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | uc_price_extras.patch | 9.95 KB | Island Usurper |
| #1 | uc_price_extras.patch | 9.06 KB | Island Usurper |
Comments
Comment #1
Island Usurper commentedSo, the problem is technically in uc_discount_price_handler_alter(), but I think it's because the $context doesn't specify what the context is well enough.
I have a patch here that takes all of the $context['subject']s that have more than one object in them, and put the ones that aren't supposed to be altered into $context['extras']. $context['context'] may or may not be a better name for it. I think there can be other ways to address the problem, but this is the one I thought of that seemed the most future-proof.
Comment #2
karens commentedI'm working with Addie on the project above and I was having problem with product kit items losing their discount when you checkout, and the above patch fixed that. I also tried it with the bundle Addie mentioned above and it worked correctly there.
There is a dpm() in the patch that needs to come out, but otherwise it works. Don't know anything about whether it is the right patch.
Comment #3
karens commentedThe last comment meant to say I don't know enough about the internals of ubercart to know anything about whether this is the best approach, I can only say that it works :)
Comment #4
Island Usurper commentedI noticed that cart items with attributes weren't being discounted, but I think that's just a problem with the discount module. I've posted a patch in that queue (#454206: Change handler callback for uc_price), so if I can get confirmation that it fixes the problem and doesn't break anything else, I think I can go ahead and commit this one as well.
Comment #5
Island Usurper commentedSince I think this is the way things will continue, and I can't find any glaring errors, I've committed this patch. There was an instance in uc_product_kit that needed to use uc_price() to begin with, so that change has been added in as well.