I'm using uc_varprice to sell event tickets by contribution. Node_checkout is also used to capture the ticketholder data. The problem is that after creating the node_checkout node, the price that is passed to the cart is always the default varprice, rather than the user-entered price. I previously tried uc_donation, and it had the same problem.
I'm a bit lost as to where to add code to check what price was entered by the customer for the product, and pass it through node_checkout to the cart. Somehow the price has to be passed as a variable (?) rather than looking it up from the product node.
If anyone can point me in the right direction to get started, I can probably muddle my way through this and hopefully create a patch that makes node_checkout compatible with price-adjusting features. Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | node_checkout_varprice.patch | 1.33 KB | ob3ron |
| #1 | node_checkout_varprice.patch | 857 bytes | ob3ron |
Comments
Comment #1
ob3ron commentedI've created a patch that adds uc_varprice compatibility. I would have liked to make it more general to handle any product features that alter the price, but I don't know if that would be possible. This patch works for me, any other input would be appreciated.
Comment #2
gtothab commentedHey,
Thanks for the patch.
I've got over 200 node checkout products that dont have the variable price feature so I was woried about how it would affect them. I also have some optional price attributes in the same ucnc node that has the variable price enabled.
All my testing so far seems promising. Successfully added variable price node with and without the optional attribute to the cart. Also added other ucnc nodes w/o the var price post patch install successfully to the cart.
If any probs pop up I'll be sure to postem' here. But if you don't hear from me again. . . no news is good news!
Cheers,
G
Comment #3
artatac commentedtrying to patch against the current dev and getting
Last login: Sun Mar 20 16:25:43 on console
unknown-00-1f-5b-f8-5e-21:~ joe$ cd /uc_node_checkout
unknown-00-1f-5b-f8-5e-21:uc_node_checkout joe$ patch < node_checkout_varprice.patch
patching file uc_node_checkout.module
Hunk #1 FAILED at 431.
Hunk #2 FAILED at 571.
2 out of 2 hunks FAILED -- saving rejects to file uc_node_checkout.module.rej
unknown-00-1f-5b-f8-5e-21:uc_node_checkout joe$
Comment #4
aidanlis commentedI don't have time to work on this, so if someone would like to provide a patch against -dev I'll gladly reopen and take a look.
Comment #5
ob3ron commentedHappily. Patched against current dev, with some enhancements over previous patch to allow for user registration / login / etc in between the price submission and the cart. I'm using this in the field and it is working perfectly for me.
Comment #6
aidanlis commentedCool will check it out.
Comment #7
aidanlis commentedImplemented, thanks for the patch!
Comment #8
ob3ron commentedThanks aidanlis! :)
Comment #10
toastytheog commentedAny chance of getting a similar patch for 7.x?
Comment #11
sata commentedmodification to patch 5 for drupal 7.x
// Add uc_varprice compatibility
if (module_exists('uc_varprice') && (isset($_SESSION['varprice']))) {
// $values['varprice'] = floatval($_SESSION['varprice']);
$data['varprice'] = floatval($_SESSION['varprice']);
unset($_SESSION['varprice']);
}