PREVIEW
How can I alter the price in a node before placing in the cart? Is there something like cart_items that I can hook into in the regular node view of the product?
STORY
I have been hacking uc_coupon so that it works a bit like uc_affiliate in that I can use /coupon/c001/node/6 and store the coupon cid in the session so I can keep a track of it right to the end.
Currently if I add a product to the cart I can alter the price in the cart with the hook_cart_items and use that. This really helps when combining coupon usage and affiliate commissions, because commissions should be calculated on the discounted price not the regular price so having the price already discounted (not just a line item) works well. But I digress.
What I want to do is to change the price before they add the product to their cart. People might get confused if they use a coupon embedded link but still see the regular price before adding.
Is there a hook or a hack I can employ to make this happen? I have looked through the hooks I know about with UberCart but think I might need to look further afield for this.
So far this is just off the top of my head, I am thinking I will need to use a callback on /arg(0)/arg(1) where arg(0)=='node' and load node from arg(1) then if (in_array($node->type, array_keys(uc_product_node_info()))) I can use hook_node_info perhaps
Any thoughts out there?
Cheers,
Stuart




Joined: 09/11/2008