Hi, my client is looking for a solution to be able to sell ads (a node checkout associated node type) to the general public, but wants to be able to make administrators and 'subscribers' exempt from paying.

Here are 2 patches that probably need a bit more work but get the job done at the minute.

Basically, i've added a new permission for each node type: 'exempt from paying for ', and this is checked at critical points along the way (hook_form_alter and hook_nodeapi).

Check out the code. I know it's late in the game being a beta and all, but i think it's a feature that more than just a handlful of people need.

Cheers!

Comments

servantleader’s picture

Great work. I absolutely need this feature for this module to be useful at all. Having hundreds of items added to the cart of the person entering conference registrations at the door is not acceptable for my project.

nicksanta’s picture

Status: Needs work » Needs review
StatusFileSize
new31.51 KB

I've revisited this after updating to beta4 yesterday. Maintainers, this really is a worthwhile feature adding to the module!

bonked’s picture

After testing this I'm going to +1 for inclusion in the full release. This is a much needed feature that doesn't get in the way for users that don't need/want it.

kirkcaraway’s picture

I agree. This is an absolute must-have feature for selling ads. A majority of our current sales are done through staff, so we need an easy way to bypass the checkout. Thanks.

kmonty’s picture

Status: Needs review » Needs work
StatusFileSize
new27.37 KB

This patch is very needed. It's very close as well, with one exception:
Users with the permission to bypass ubercart receive this nasty, red error message: "is not a product. Unable to add to cart."

That said, the node still appears and is not added to cart. Regular users that have to pay are unaffected. I'm going to attempt to solve this bug, then I believe we can commit this patch.

kmonty’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new31.49 KB

Okay, the fix was really easy. In hook_nodeapi...
if (!user_access('exempt from paying for '. $form['type']['#value'])) {

should have been:
if (!user_access('exempt from paying for '. $node->type) {

Fixed the patch. I'd say it's ready for a commit.

fletch11’s picture

+1 for commit but it does not appear that the maintainer is active in this project. Is there anyone up to the task of taking it over?

Neil C Smith’s picture

Comment with last patch seems to have right idea, but patch seems to change hook_form_alter() instead of hook_nodeapi().

ezra-g’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Sorry, but I don't follow the approach here.

Making some exempt from paying seems like a general need that's not specific to uc_node_checkout that could be addressed with the coupon/discount modules. Why should we add code to uc_node_checkout to support this use case?

I can understand letting users, such as admins submit nodes without going through the checkout process, such as #954668: Allow bypass of checkout process.

Perhaps I'm just missing something here :).

Neil C Smith’s picture

Version: 6.x-2.0-beta3 » 6.x-2.0-beta4

We're using a patched version of beta4 for a client at the moment, and with development on this module now seeming to be going on again it would be great to see this functionality added in - the patch (with additional changes I mentioned above) is working great for us.

In response to the previous comment, and why #954668: Allow bypass of checkout process is not good enough for us, we absolutely need to do this on a per-content type basis. Our client (and I quite agree with them) does not want the customer to need to go anywhere near the cart system when the user has permission to create a certain content type - not something I think would be possible using the coupon / discount modules. This module allows nodes to be treated as products when necessary - IMO it shouldn't force them always to be treated differently.

aidanlis’s picture

Version: 6.x-2.0-beta4 » 6.x-2.x-dev
Status: Postponed (maintainer needs more info) » Needs work

I've had clients request this feature, so I'll allow the patch, however someone will need to make the patch against git master and set this to "needs review".

ashhishhh’s picture