Back to G. Eventbrite
Eventbrite Discounts
Figure 1. Instantiate Discounts
//user type
$discount = eden('eventbrite')->discount($_SESSION['ebtoken']);
//personal type
$discount = eden('eventbrite')->discount('[USER_KEY]', '[APP_SECRET]');
Figure 2. Usage: Creating a Discount
$discount
->setCode('membersonly') //required
->amountOff(12) //required either amount off or percent off not both
->percentOff(0) //required either amount off or percent off not both
->setTickets() //optional comma separated ticket IDs, leave blank for all
->setQuantity(50) //optional
->setStart(time()+3600) //required unix time or date format
->setEnd(time()+7200) //required unix time or date format
->create(123); //event ID
Figure 3. Usage: Updating a Discount
$discount
->setCode('membersonly') //required
->amountOff(12) //required either amount off or percent off not both
->percentOff(0) //required either amount off or percent off not both
->setTickets() //optional comma separated ticket IDs, leave blank for all
->setQuantity(50) //optional
->setStart(time()+3600) //required unix time or date format
->setEnd(time()+7200) //required unix time or date format
->update(123); //discount ID
Figure 4. Discount Methods
Method |
Arguments |
Returns |
Description |
$discount->create($event);
|
- int
- the event id
|
array |
Creates the discount |
$discount->setAmountOff($amount);
|
- float|int
|
Eden_Eventbrite_Discount |
Sets the discount amount |
$discount->setCode($code);
|
- string
|
Eden_Eventbrite_Discount |
Sets the discount code |
$discount->setEnd($end);
|
- string|int
|
Eden_Eventbrite_Discount |
Set the end time |
$discount->setPercentOff($percent);
|
- float|int
|
Eden_Eventbrite_Discount |
Sets the discount percent |
$discount->setQuantity($quantity);
|
- int
|
Eden_Eventbrite_Discount |
Set quantity |
$discount->setStart($start);
|
- int|string
|
Eden_Eventbrite_Discount |
Set the start time |
$discount->setTickets($tickets);
|
- string|array
|
Eden_Eventbrite_Discount |
Set ticket ID or a list of ticket IDs |
$discount->update($id);
|
- int
- the discount id
|
array |
Creates the discount |