Closed (won't fix)
Project:
Ubercart
Version:
6.x-2.0-rc7
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
16 Oct 2009 at 19:40 UTC
Updated:
27 May 2011 at 13:50 UTC
Attached is a patch I created to add hook_product_alter. I created this out of the necessity to access properties of products right at the point that uc_product interacts with these properties, and if the community finds it helpful enough, hopefully it could be included into ubercart.
hook_uc_product_alter($op, &$arg1)
$op:
* validate
* insert
* update
* load
$arg1:
for "load" returns $product object
all others returns $node object
| Comment | File | Size | Author |
|---|---|---|---|
| uc_product_alter.patch | 3.14 KB | cangeceiro |
Comments
Comment #1
cangeceiro commentedoops, boogered the patch
Comment #2
rszrama commentedAs far as I know, alteration hooks are really only used for altering data bits when an entity is loaded. Drupal is also moving away from $op oriented hooks. I could possibly see putting a drupal_alter() in the uc_product_load() function, but doing it again in the saving functions isn't the right place.
Since this won't represent an API change, I'd still be comfortable considering this for inclusion after we get 2.0 out... will let Lyle concur.
Comment #3
longwaveNothing here that can't be done with hook_nodeapi as far as I can tell.