Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ticket messaging when camp is closed. #1404

Open
wants to merge 3 commits into
base: production
Choose a base branch
from

Conversation

StevenDufresne
Copy link
Contributor

Related: #1403

When a WordCamp is closed, we still display messaging that appears like a ticket may be sold later. This PR updates that message to explain the camp is closed.

I also created an is_wordcamp_closed function as opposed to checking the post type so we can start to refactor. I updated the only other reference in this file as well.

Screenshots

Example: https://asia.wordcamp.org/2024/tickets/

Before After
Screenshot 2024-10-21 at 10 47 14 AM Screenshot 2024-10-21 at 10 41 45 AM

@@ -5485,10 +5485,14 @@ function form_start() {
$this->error( __( "It doesn't look like your form submitted any attendee information. Please try again.", 'wordcamporg' ) );
}

if ( ! $available_tickets ) {
if ( ! $available_tickets && ! $this->is_wordcamp_closed() ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsure of the intention here, but guess it might want to be OR instead of AND since we're checking negatives

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it reads a bit weird. It is likely better as ! available_tickets && $this->is_wordcamp_open() but that function doesn't exist. It cannot be an OR clause based on how the code currently functions, however.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the problem is that this notice would then only show if the wordcamp has closed and there are no available tickets, which is different to the current function which would show this message when there aren't available tickets regardless of status.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the problem is that this notice would then only show if the wordcamp has closed

The logic is ! $this->is_wordcamp_closed() or specifically ! 'wcpt-closed', meaning anything before closed which I think is fine. I think I'm missing what the problem is. I could create another helper function that targets wcpt-scheduled if that makes this more readable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah - but if there are available tickets, and the wordcamp is closed, this wouldn't trigger...

@@ -0,0 +1,74 @@
Index: camptix.php
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guess this was included in the PR by mistake?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants