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!

Comments

ob3ron’s picture

Title: Pass altered price to cart through node_checkout » Pass uc_varprice price to cart through node_checkout
Category: support » feature
Status: Active » Needs review
Issue tags: +uc_node_checkout
StatusFileSize
new857 bytes

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

gtothab’s picture

Hey,

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

artatac’s picture

trying 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$

aidanlis’s picture

Status: Needs review » Postponed
Issue tags: -uc_node_checkout

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

ob3ron’s picture

Status: Postponed » Needs review
StatusFileSize
new1.33 KB

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

aidanlis’s picture

Assigned: Unassigned » aidanlis

Cool will check it out.

aidanlis’s picture

Status: Needs review » Fixed

Implemented, thanks for the patch!

ob3ron’s picture

Thanks aidanlis! :)

Status: Fixed » Closed (fixed)

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

toastytheog’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev

Any chance of getting a similar patch for 7.x?

sata’s picture

Issue summary: View changes

modification 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']);
}