I'm using your module (which is awesome so far!) and having an issue where when a user registers, the "count" isn't being added to the registration total for that product.

I have verified a few ways:
1) The "# slots available" count doesn't change
2) The "Manage Registrations" page is showing the registration with a count of 0.
3) Clicking "edit" on the registration brings up the form. If I set the value (currently 0) to 1 and save the form, the "# slots available" and "# slots are filled" values update accordingly.

Comments

agileadam’s picture

This may actually be a bug with the registration module?

jpontani’s picture

Thanks! Glad you're liking it and hopefully finding it useful.

Registrations are only added once the action "Mark registrations as paid" is fired from Rules. I originally had this logic included upon checkout completion, but removed it as I figured users might want to add their own logic as when a registration should be considered "completed".

You can add this action to any Rule as long as the event provides a Commerce Order object.

I'll check as well to see that I'm setting the count properly on the registration, if not I'll update this with a patch.

agileadam’s picture

Oh! Awesome! jpontani, you're FAST. Your approach makes sense; I guess I should have looked at the rules before posting a bug.
I'll have a gander now.

Thanks!

jpontani’s picture

Status: Active » Postponed (maintainer needs more info)

Yea I'm trying to get in a good habit of getting stuff fixed quickly for this module.

Let me know how it turns out, things seem to be working for me when the rule is fired.

agileadam’s picture

So I modified your default rule (Mark registrations as confirmed upon full payment) to trigger on the event "Completing the checkout process."
Should I, at this point, expect that when a user completes the checkout process the slots available will go down by one (and the count up by one)?
The count remains unchanged.
I should mention that the registration does show up, so it is being saved... but it remains with a count of 0. This same behavior happened before I made the change to the rule.

Am I doing something wrong?

jpontani’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new618 bytes

Ah ok. What version of Entity Registrations are you using? It might be something in there that is defaulting the count to 0, not sure.

I went ahead an created a patch that forces the count to be 1.

agileadam’s picture

Oh poop! Now I remember that I'm using version 7.x-1.0-alpha4 (and you explicitly say your module works with alpha3. Sorry.

jpontani’s picture

As long as you're using at least alpha3 it's fine.

agileadam’s picture

Alright. I've applied the patch.

With the default rule (Mark registrations as confirmed upon full payment) unmodified, the "slots available" dropped by one when a user finished checkout.
So, the order status is "Pending" but the count still went in as a 1. I think this contradicts what you said earlier, but maybe I misunderstood you. Maybe the "commerce_registration_mark_paid" rules action has nothing to do with this "count" business?

Either way, currently, with your alpha3 module and the single patch above the system works exactly how I want, out of the box. This is awesome!
Many thanks!

jpontani’s picture

Status: Needs review » Postponed (maintainer needs more info)

Strange. I can't reproduce this behavior. With the rule disabled, I get no registration saved and the available slots are correct. With the rule enabled and registrations being marked as paid, the registration gets saved and the slots update to reflect 1 less available.

Going to look more into it to see what may be happening.

agileadam’s picture

Thank you. I don't believe I've left out any details. I'll disable the rule and see what happens.

agileadam’s picture

Alright. I disabled the default rule (Mark registrations as confirmed upon full payment) and the registration was not added.
Maybe this is happening because I'm using the "Example" payment method (the one that ships with Commerce)?

jpontani’s picture

Ok so the default rule marks registrations as paid upon full payment. The Example payment method marks orders as "paid in full" upon checkout completion. However, there is no default rule that marks an order as "Completed", that is something that is added by the user.

So here's whats happening:

  1. You complete checkout.
  2. Your order is marked as paid in full from Example payment.
  3. Your registration is saved and is now taking up 1 space.
  4. Your order is NOT marked as Complete because there is no rule to do that.

You need to update the rule "Update the order status on checkout completion" to set the order status to complete if that's what you want, or you can have it set to mark as complete when the order is paid in full. That choice is yours. The logic for Registration is different. You can have the registration be saved upon checkout completion, OR when the order is paid in full. It all depends on what you want and your situation.

agileadam’s picture

Wow jpontani, you really hit the nail on the head. That's got to be exactly what's happening.

So, to confirm:

  1. I'm not going to be using the example payment method permanently, so I'm going to either install a test credit card payment gateway (so orders aren't paid immediately), or TEMPORARILY modify the Update the order status on checkout completion" rule to update the order state to "Completed" instead of "Pending"
  2. I'm still using the patch listed in #6 above.

Thanks so much for your help. I understand the process now. Would you mind putting a note about the default Rule and how the process works in the README.txt file? Even if it's a quick blurb it'd help a ton. I guess you'd be further-detailing what you already have: "When through with the order, the registration will be saved once the checkout is complete." I'm not sure if it's worth it, but you may also want to put in a note about the "example" payment method automatically marking items as "paid."

Cheers mate! Thanks again for your work on this.
-Adam

jpontani’s picture

Status: Postponed (maintainer needs more info) » Fixed

Yes, you are correct in your items.

Definitely use the patch #6. I applied it to the dev branch and will probably make that the next alpha release. I'm saving beta releases until Registration goes into beta.

Good idea, I will update the README to explain this so people don't get confused later on.

Status: Fixed » Closed (fixed)

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