Closed (fixed)
Project:
e-Commerce
Version:
6.x-4.x-dev
Component:
cart
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Nov 2008 at 14:32 UTC
Updated:
11 Dec 2008 at 15:52 UTC
I have implemented a hook_ec_checkout_validate_item() in my Drupal 6 module (see: ec_checkout_validate_item() function).
What is really strange for me, my module can't modify the node id in this function. It was possible under Drupal 5 / e-Commerce 3.5.
I think the problem is in the ec_cart_update_item() function. After ec_checkout_validate_item($node, 'cart', $qty, $data) we need an another line:
$nid = $node->nid;
So the modules can modify the nid, if they want.
Comments
Comment #1
gordon commentedComment #2
gordon commentedI haven't tested it, but I see no reason why you can't. This is why I used the ..._get_function() to get the function name.
Make sure that your hook implementation has &$node so you can modify it.
Comment #3
foripepe commentedMy hook use &$node, and I have tested, the $node object has the correct id in the ec_cart_update_item(), but unfortunately the _ec_cart_save() use the (old) $nid.
Comment #4
gordon commentedThanks this should be fixed now.
Let me know if it isn't