Closed (duplicate)
Project:
UC Discount Framework
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Jun 2009 at 13:05 UTC
Updated:
16 Jun 2009 at 17:08 UTC
Currently UC Discounts Framework doesn't work if you try to add products from admin area (ex: 'admin/store/orders/97/edit') - they don't get the discounts applied. The same products if added to Cart as a normal buyer get discounted.
Is there currently a workaround for this ?
Comments
Comment #1
andreiashu commentedIt seems that in
uc_discount_price_handler_alterfunction the two if s don't validate so thecalculate_product_discountstrigger doesn't get pulled.I'm bumping the priority because this issue renders this module useless on sites that take orders through phone for example...
I still have no idea for now how to solve this.
Comment #2
andreiashu commentedI managed to make a workaround for this by implementing a hook_cart_item and pulling the required trigger from here:
Is there another simpler solution for this ?
@Islander: do you have some opinions about this ?
Thanks !
Comment #3
andreiashu commentedChanging status and title
Comment #4
jantoine commentedandreiashu,
I tried implementing the hook_cart_item() hook as you suggested but I was unable to get this to resolve the issue. I am still unable to get products to reflect discounts when added via the admin area. Was there something else you did to get the hook to fire? It doesn't seem to be firing on my system. I am using Ubercart 6.x-2.x-rc3, the latest development release of uc_discounts and products with attributes (not sure that the last one matters).
Cheers,
Antoine
Comment #5
jantoine commentedChanging Status
Comment #6
andreiashu commented@AntoineSolutions: thanks for testing it out. Indeed it does work only in certain cases... I also use attributes (and I need my discounts to take into consideration the value of the selected attributes).
I will investigate more on this one. I post back some feedback hopefully this next week.
Cheers,
Andrei
Comment #7
andreiashu commentedI've been thinking more about this and I think this should be reported as a bug in UC. Why is the $context array different in the admin area from the normal client area ?
I managed to make a workaround for this but it is really nasty: caching discounts for the order in {cache} table until the order is finished and I'm not even sure if it will work in all situations...
Comment #8
andreiashu commentedI still think that instead of finding a workaround for this we should fix the core problem that relies in UC.
I opened an issue for UC here: #492090: Admin area has different $context array for hook_uc_price_handler than "client" area.
Comment #9
Island Usurper commentedI was going to switch this issue over to the Ubercart queue, but you beat me to it. I guess that's what I get for going to lunch. ;)
I'll just close this one out and deal with the other issue.