Closed (fixed)
Project:
UC Down Payment
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jan 2012 at 19:44 UTC
Updated:
10 Apr 2015 at 17:12 UTC
Jump to comment: Most recent
Comments
Comment #1
sokrplare commentedThis has been resolved by changing the modules execution order, by setting the weight for this module to -1 in the system table, and making sure that this module is executed before other UC contrib modules. Please download the most recent dev version.
Comment #3
dannypfeiffer commentedAfter experiencing the same duplicate email issue (after upgrading to ubercart 6.x-2.9), i installed the latest dev here.
The problem with moving weight to -1, is it interferes with attribute-enabled products. So while it results in a single order email and stock-decrement, it unfortunately removes the display of attributes on an item during checkout.
Thoughts?
Comment #4
dannypfeiffer commentedswitching this back to needs work, took a peek at the code, but no clear resolution in my mind yet...
Comment #5
dannypfeiffer commentedWondering if the hook_product_description in uc_downpayment.module (line 309) is necessary? Commenting out this hook allows attribute descriptions to render properly on order and checkout screens, even while the module has a system weight of -1.
I don't see any adverse affects ...
Comment #6
sokrplare commentedTotally busy with work right now, but off the top of my head that seems viable. If you've got a patch I'll review here in a bit and commit. Good idea!
Comment #7
alansch commentedI've just needed to revisit the problem of interaction between downpayments and product attributes. After *many* hours of frustration and numerous megabytes of traceprints, I have arrived at a solution whose simplicity is totally out of proportion to the effort expended --resigned sigh--
Ubercart calls the product_description hook via Drupal's module_invoke_all function. This tests for the existence of a function called (modulename)_product_description for each currently enabled module and combines any arrays returned into a single array using the PHP function array_merge_recursive. (Scalar returns are handled a bit differently but that's not relevant here.)
Unfortunately, in uc_downpayment_product_description, you have chosen to return an array with a single element called 'attributes' which is a naming conflict with the similar array returned by uc_attributes_product_description. The resulting merged array now contains an element '#theme' which instead of being a scalar reference to a theming function is now an array containing two theming function names.
The theming layer in Drupal expects to find a scalar function name and, as a result, *nothing* gets rendered.
The fix? In uc_downpayment_product_description, change the array element 'attributes' to something else, eg 'downpayment'.
Line 306 of uc_downpayment.module...
So now the 'attributes' array is rendered by theme_uc_product_attributes(), and the 'downpayment' array is rendered by theme_uc_downpayment_product_description() as they should be, and everything displays happily.
Comment #9
sokrplare commented