Skip to content

Commit

Permalink
Merge branch 'release/T24.hydra' into fix/AR_Page_Infinite_Loop_FSE
Browse files Browse the repository at this point in the history
  • Loading branch information
dpanta94 authored Dec 4, 2024
2 parents 8efd8f7 + 3449988 commit 1e05de1
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 18 deletions.
4 changes: 4 additions & 0 deletions changelog/feat-sl-205-purchase-limit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: feat

Add support for max ticket purchase limit filter with seating tickets. [SL-205]
10 changes: 8 additions & 2 deletions src/Tickets/Seating/Frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use Tribe__Main as Common;
use TEC\Tickets\Commerce\Checkout;
use TEC\Tickets\Seating\Orders\Cart;
use Tribe__Tickets__Tickets_Handler as Tickets_Handler;

/**
* Class Controller.
Expand Down Expand Up @@ -455,7 +456,8 @@ public function get_ticket_block_data( $post_id ): array {
* ticketId: string,
* name: string,
* price: string,
* description: string
* description: string,
* maxLimit: int
* }>
* } The Seat Type map.
*/
Expand Down Expand Up @@ -489,13 +491,17 @@ public function build_seat_type_map( ?int $post_id = null ): array {
'tickets' => [],
];
}


/** @var Tickets_Handler $tickets_handler */
$tickets_handler = tribe( 'tickets.handler' );

$seat_type_map[ $seat_type ]['tickets'][] = [
'ticketId' => $ticket_id,
'name' => $ticket->name,
'price' => $ticket->price,
'description' => $ticket->description,
'dateInRange' => $ticket->date_in_range(),
'maxLimit' => $tickets_handler->get_ticket_max_purchase( $ticket_id ),
];
}

Expand Down
1 change: 1 addition & 0 deletions src/Tickets/Seating/app/frontend/ticketsBlock/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const confirmSelector =
* @property {string} name The ticket name.
* @property {number} price The ticket price.
* @property {string} description The ticket description.
* @property {number} maxLimit The maximum number of tickets that can be selected.
*/

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
"name": "Test TC ticket for {{post_id}}",
"price": "20",
"description": "Test TC ticket description for {{post_id}}",
"dateInRange": true
"dateInRange": true,
"maxLimit": 100
},
{
"ticketId": {{ticket_4}},
"name": "Test TC ticket for {{post_id}}",
"price": "30",
"description": "Test TC ticket description for {{post_id}}",
"dateInRange": true
"dateInRange": true,
"maxLimit": 100
}
]
},
Expand All @@ -29,14 +31,16 @@
"name": "Test TC ticket for {{post_id}}",
"price": "50",
"description": "Test TC ticket description for {{post_id}}",
"dateInRange": true
"dateInRange": true,
"maxLimit": 100
},
{
"ticketId": {{ticket_5}},
"name": "Test TC ticket for {{post_id}}",
"price": "10",
"description": "Test TC ticket description for {{post_id}}",
"dateInRange": true
"dateInRange": true,
"maxLimit": 100
}
]
},
Expand All @@ -48,7 +52,8 @@
"name": "Test TC ticket for {{post_id}}",
"price": "10",
"description": "Test TC ticket description for {{post_id}}",
"dateInRange": true
"dateInRange": true,
"maxLimit": 100
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"name": "Test TC ticket for {{post_id}}",
"price": "20",
"description": "Test TC ticket description for {{post_id}}",
"dateInRange": true
"dateInRange": true,
"maxLimit": 100
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"name": "Test TC ticket for {{post_id}}",
"price": "20",
"description": "Test TC ticket description for {{post_id}}",
"dateInRange": true
"dateInRange": true,
"maxLimit": 0
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"name": "Test TC ticket for {{post_id}}",
"price": "20",
"description": "Test TC ticket description for {{post_id}}",
"dateInRange": false
"dateInRange": false,
"maxLimit": 100
}
]
},
Expand All @@ -22,7 +23,8 @@
"name": "Test TC ticket for {{post_id}}",
"price": "10",
"description": "Test TC ticket description for {{post_id}}",
"dateInRange": false
"dateInRange": false,
"maxLimit": 100
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"name": "Test TC ticket for {{post_id}}",
"price": "20",
"description": "Test TC ticket description for {{post_id}}",
"dateInRange": false
"dateInRange": false,
"maxLimit": 100
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"name": "Test TC ticket for {{post_id}}",
"price": "10",
"description": "Test TC ticket description for {{post_id}}",
"dateInRange": false
"dateInRange": false,
"maxLimit": 100
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"name": "Test TC ticket for {{post_id}}",
"price": "20",
"description": "Test TC ticket description for {{post_id}}",
"dateInRange": true
"dateInRange": true,
"maxLimit": 100
}
]
},
Expand All @@ -22,7 +23,8 @@
"name": "Test TC ticket for {{post_id}}",
"price": "50",
"description": "Test TC ticket description for {{post_id}}",
"dateInRange": true
"dateInRange": true,
"maxLimit": 100
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
"name": "Test TC ticket for {{post_id}}",
"price": "10",
"description": "Test TC ticket description for {{post_id}}",
"dateInRange": false
"dateInRange": false,
"maxLimit": 100
},
{
"ticketId": {{ticket_3}},
"name": "Test TC ticket for {{post_id}}",
"price": "30",
"description": "Test TC ticket description for {{post_id}}",
"dateInRange": true
"dateInRange": true,
"maxLimit": 100
}
]
},
Expand All @@ -29,7 +31,8 @@
"name": "Test TC ticket for {{post_id}}",
"price": "20",
"description": "Test TC ticket description for {{post_id}}",
"dateInRange": false
"dateInRange": false,
"maxLimit": 100
}
]
}
Expand Down

0 comments on commit 1e05de1

Please sign in to comment.