Hi,

I'm seeing notes all over the module about making sure users do not have the "sign up for content" permission. However, we would like to skip the cart checkout for free events.

We have set up two different content types: one for free signups, one for paid. And we see the sign-up form on free events, and an add to cart button on paid ones.

Is it possible to bypass the cart for paid events? If so, how?

After reviewing some of the code for uc_signup and signup, if it's currently possible to bypass payment on paid events if the user has the "sign up for content" permission, it should be simple to fix this with an implementation of hook_signup_suppress(). For example:

/**
 * Implements hook_signup_suppress.
 *
 * Suppress sign-up form for uc_signup products.
 */
function uc_signup_signup_suppress($node) {
  if ($node->sell_price > 0) {
    return true;
  }
}

... but this doesn't appear to do anything as the form is already suppressed!

If it's not possible to bypass checkout on paid events, then we need to do some documentation fixes.

CommentFileSizeAuthor
#11 982678-skip-free.patch4.55 KBezra-g

Comments

ezra-g’s picture

Category: feature » support
Status: Active » Postponed (maintainer needs more info)

What version of the module are you using that says you need to deny users the 'sign up for content' permission?

uc_signup already implements hook_signup_suppress, and I don't see a mention of the "sign up for content" permission in the README.

freelock’s picture

Status: Postponed (maintainer needs more info) » Fixed

Ok. Never mind...

Somehow we were running a Feb. 10 dev version of uc_signup (confused as to why that would be, we started this only a couple months ago). Updated to beta6, and indeed hook_signup_suppress is implemented, and the README note is gone...

Sorry for the noise!

john franklin’s picture

This works fine for free events... however we have events that are free to users with the "membership" role, but are not free for others. We use uc_price_per_role to manage that, which means the $node->sell_price may not be the actual price for the user. Is there a way to way to suppress signup only when the user's price is non-free?

Status: Fixed » Closed (fixed)

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

mkalbere’s picture

Status: Closed (fixed) » Active

I read twice the first post, and there is definitely some-thing I dont understand.
uc_signup works perfectly for non-free events, I would like the "signup" form to be displayed on free events, and I cann't. The "add-to-cart" link is systematicaly displayed .. did I miss something ?

The strangest is that : uc_signup_signup_suppress is ok (I mean it doesn't return true)
the unset is not done in uc_signup_nodeapi

Using latest "dev" version, of both signup & uc_signup

ezra-g’s picture

Status: Active » Postponed (maintainer needs more info)

Which theme are you using? I'm unable to replicate with Garland but can replicate with acquia_prosper. Acquia_prosper and fusion_core do some preprocessing of variables, and this sounds somewhat like #993048: fusion created an unwanted node-product.tpl.php -- I'll also take a look and see if perhaps something gets missed in preprocessing - It's not all non-uc items in $node->content, since I've got a date field that still renders.

ezra-g’s picture

And, a patch at #1012882: Full $node->content arary not built for Ubercart products.

I'll mark this issue needs review for that patch, but would still love to get people's feedback on which theme's they're using.

john franklin’s picture

Most of my sites are Zen-based themes, including the site using UC.

ezra-g’s picture

Status: Postponed (maintainer needs more info) » Active

I was able to reproduce this problem with UC dev and uc_signup dev. Bummer!

ezra-g’s picture

Title: Skipping uc_signup for free events » Skip uc_signup for free events
Category: support » feature

It seems I've made a mistake here. I was probably thinking of #760336: Prevent signup form from appearing on non-free events, which is basically the opposite of this feature.

Let's allow folks to signup without going through the checkout process, but let's make that a configurable option, in case site builders want to have all products result in the user going through the checkout process.

ezra-g’s picture

Status: Active » Needs review
StatusFileSize
new4.55 KB

I've tested this with free and paid events with the setting checked and unchecked.

ezra-g’s picture

Status: Needs review » Needs work
+++ b/uc_signup.module
@@ -545,10 +545,11 @@ function theme_uc_signup_confirmed_signups_text($signups = NULL, $admin = FALSE)
-  if (isset($node->sell_price) && $node->sell_price > 0) {
+  if (isset($node->sell_price) && $node->sell_price > 0 || !variable_get('uc_signup_skip_checkout_free', 1)) {

We should always suppress signup for non-free events.

+++ b/uc_signup.module
@@ -560,7 +561,7 @@ function uc_signup_signup_suppress($node) {
-      if (isset($node->sell_price) && $node->sell_price > 0) {
+      if (isset($node->sell_price) && $node->sell_price > 0 || !variable_get('uc_signup_skip_checkout_free', 1)) {

Same as above

Powered by Dreditor.

ezra-g’s picture

Status: Needs work » Needs review

I misread this patch and tested on a buggy site. This is correct.

socialnicheguru’s picture

if it is a free event and the email is in the system can I have uc_signup enabled and just skip the order page and confirmation page so that it is no more than a two step process.

If all items are $0 value:
i click signup
I enter my email or it is already there
Thank you confirmation page

socialnicheguru’s picture

btw - the above patch works.
It just skips the add to cart and gets the signup button instead.

Will it still create a user account if the user doesn't have a system account?
I think it just disables uc_signup and enabled signup. If that is true, then the answer to my second question is no.

tfmy2k’s picture

I made the above patch: however, now i am getting two (Qty: 2): Sign-Up buttons.

One of them appears to be working fine for the "FREE" event: However, it does not ouputting any messages that "You have been registered for this event".

What am i doing wrong here?

Thanks.

ezra-g’s picture

Status: Needs review » Fixed

> Will it still create a user account if the user doesn't have a system account?
> I think it just disables uc_signup and enabled signup. If that is true, then the answer to my second question is no.

That is correct.

> I made the above patch: however, now i am getting two (Qty: 2): Sign-Up buttons

I was unable to replicate this behavior with the patch applied, however, that is behavior that happens without the patch applied.

This is committed. Thanks! http://drupalcode.org/project/uc_signup.git/commitdiff/d052b78?hp=a675a3...

Status: Fixed » Closed (fixed)

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