Closed (fixed)
Project:
Ubercart
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
19 Dec 2008 at 14:40 UTC
Updated:
9 Mar 2009 at 15:30 UTC
Jump to comment: Most recent file
There are a few places where Ubercart assumes that cart items or ordered products have options from uc_attribute.module. These are usually for display purposes, but other modules ought to be able to inject their own data like this. In other words, uc_attribute should behave like a contrib module, even if it is distributed with core.
hook_add_to_cart_data() feels like a step in the right direction, but we didn't follow through all the way.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | order_attribute_divorce.patch | 4.52 KB | Island Usurper |
| #11 | order_attribute_divorce.patch | 4.52 KB | Island Usurper |
| #9 | order_attribute_divorce.patch | 4.63 KB | Island Usurper |
| #7 | order_attribute_divorce.patch | 4.71 KB | Island Usurper |
| #3 | disentangle_attributes.patch | 14.27 KB | Island Usurper |
Comments
Comment #1
Island Usurper commentedThis patch handles uc_cart so that uc_attribute data is handled more anonymously. uc_order will need some more work.
The patch adds a new hook:
$item is an individual item in the cart as returned by uc_cart_get_contents(). It's the same mechanism as hook_cart_display(), since that's where the hook should be invoked. (I was going to put it elsewhere, like the cart block, or the cart pane, but things got hairy and didn't look consistent.)
I set this to review so it would be reviewed. I'll think more about handling uc_order. I think there might need to be a reverse hook_add_to_cart_data() or something.
Comment #2
Island Usurper commentedcha0s made the point that the CSS class for this data should be semantic, and we are not necessarily showing product options any more. So this patch changes .product-options to .product-description.
Comment #3
Island Usurper commentedThe new hook needed some documentation in the hooks.php file, so I've added that in. I'm going to commit it since it won't hurt, even though it might become outdated before too long. We'll see.
Comment #4
Island Usurper commentedAnd since that spot in uc_order still needs to be taken care of, this issue is still active.
Comment #5
Island Usurper commentedComment #6
rszrama commentedComment #7
Island Usurper commentedYay! I think I got something that works. And as an added bonus, it fixes a bug that keeps that page from adding the option you want to manually added products.
Comment #8
rszrama commentedThere are debug messages in here, including a dpm() call... not even gonna try to test it since I don't have devel. ; )
Comment #9
Island Usurper commentedI get excited sometimes and forget to clean up my patches. :P
Comment #10
rszrama commentedPatch did not work on the 2.x Livetest - failed to consider attributes at all. Also, need to remove the check
module_exists('uc_attribute')from the attribute module.Comment #11
Island Usurper commentedRemoved the (now silly) module_exists() call, and let attributes that use select elements to be chosen instead of just radio buttons. >_<
Comment #12
Island Usurper commentedOne more time, for great justice!
Comment #13
Island Usurper commentedRyan gave his approval, after it (finally) worked on the livetest site, so it's committed.
Comment #14
Macronomicus commentedYes it works wonderfully, and fixes the bugs I had with the order form attributes behaving very badly! >_<
But what did you commit it to?
I dont see a new beta or dev?
Do I need to look in CVS for the freshest bits?
I applied the patch so I guess I dont need it, but im just curious; where is the latest build is usually lurking? ^_^
Comment #15
Island Usurper commentedWe usually commit to the Bazaar repository we have first, and then push a bunch of changes to CVS here every so often. Instructions for accessing the Bazaar repo can be found at http://www.ubercart.org/bazaar.