Hi Wolf,
Glad you like the plug-in.
Currently you could create several tickets (with/without t-shirt) with different prices, and add t-shirt size field option (although this option would still appear to those not selecting the with t-shirt ticket).
If you were to go down the manual HTML route (though I wouldn’t recommend it) you could use the ‘HTML’ form field, which allows arbitrary HTML to be added to the booking form. Or the ‘hook’ field which triggers a particular action (allowing you to hook onto that with a callback function).
To adjust the booking total you could use the eventorganiser_pre_gateway_checkout_paypal
filter, which filters the ‘cart’ that is sent to PayPal. Additionally you could adjust the booking amount using the filter eventorganiser_get_booking_meta_booking_amount
(this adjusts what is seen on the bookings page / e-mails etc).
To give you an idea of how to alter the cart sent to PayPal
function my_alter_paypal_cart( $cart, $booking ){
//$booking is an array. $booking['booking_id'] contains the booking ID
/*
$cart is of the form:
$cart = array(
'return' => //return url
'item_name_0' => //Ticket name,
'amount_0' => //Ticket price
'quantity_0' => //Ticket quantity,
'item_name_1' => //Ticket name (second ticket type),
'amount_1' => //Ticket price (second ticket type),
'quantity_1' => //Ticket quantity (second ticket type),
....
'custom' => //custom data as query variables. e.g. booking_id=X&event_id=Y...
);
*/
//Adjust $cart and return it
return $cart;
}
add_filter( 'eventorganiser_pre_gateway_checkout_paypal', 'my_alter_paypal_cart', 5, 2 );
Each ticket type being purchased appears as a separate item, and there’s no limit to the number of ticket types there could be. You would need to add another item after them with a name (e.g. “T-shirt”), price and quantity (1, probably).
As you can see its not for the faint-hearted :).
“Priced fields” (booking form fields which adjust the price of the booking) are on the road map – though there is currently no ETA for this feature.