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

[SL-253] Update seating availability calculation depending on seat reservation. #3461

Open
wants to merge 83 commits into
base: master
Choose a base branch
from

Conversation

rafsuntaskin
Copy link
Contributor

🎫 Ticket

SL-253

🗒️ Description

  • Updated stock calculation for seated tickets to only count attendees with reservation meta as valid attendees.
  • If the attendee doesn't have reservation data it will not be counted towards stock.

🎥 Artifacts

🎥 screencast(s): https://share.cleanshot.com/59KQgGdS

✔️ Checklist

  • Ran npm run changelog to add changelog file(s). More info here
  • Code is covered by NEW wpunit or integration tests.
  • Code is covered by EXISTING wpunit or integration tests.
  • Are all the required tests passing?
  • Automated code review comments are addressed.
  • Have you added Artifacts?
  • Check the base branch for your PR.
  • Add your PR to the project board for the release.

@rafsuntaskin rafsuntaskin added the needs release Needs an associated release in Jira before merging. label Dec 18, 2024
Copy link
Contributor

@lucatume lucatume left a comment

Choose a reason for hiding this comment

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

An optional really small code change, otherwise fine.

* @since TBD
*
* @param int $stock The stock level of the ticket.
* @param Tribe__Tickets__Ticket_Object $ticket The ticket object.
Copy link
Contributor

Choose a reason for hiding this comment

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

Alias this to Ticket_Object and improve the code readability.

src/Tribe/Tickets.php Outdated Show resolved Hide resolved
if ( ! isset( $capacity_by_type[ $seat_type ] ) ) {
$capacity_by_type[ $seat_type ] = $capacity;
}

Copy link
Member

Choose a reason for hiding this comment

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

Remove these tabs.

$capacity = $ticket->capacity();
$stock = $ticket->stock();
$sold_qty = $ticket->qty_sold();


Copy link
Member

Choose a reason for hiding this comment

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

Remove these tabs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs release Needs an associated release in Jira before merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants