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

gordon’s picture

Version: master » 6.x-4.x-dev
gordon’s picture

I 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.

foripepe’s picture

My 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.

gordon’s picture

Status: Active » Fixed

Thanks this should be fixed now.

Let me know if it isn't

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.