Support

Home Forums Event Espresso Premium EE_Ticket doens't save correctlly

EE_Ticket doens't save correctlly

Posted: March 28, 2017 at 6:36 am

Viewing 4 reply threads


lexavss

March 28, 2017 at 6:36 am

Hello, when i save a ticket with the EE_Ticket class and show it, the ticket price is saved with no problem. But when i go to the event page the ticket price is 0 $ on the event.


Tony

  • Support Staff

March 28, 2017 at 7:56 am

Hi there,

You mention the EE_Ticket class so I’m assuming you’ve added some custom code to create tickets and your not using the standard ticket editor within the admin?


lexavss

March 28, 2017 at 9:32 am

Hey, thank’s for the response so , here’s the code

// I add the event and datetime of the event before it’s return me the ID ,
// I use the ID to add my ticket

$new_ticket=EE_Ticket::new_instance(

array(
‘TKT_name’=> $nameEvBillet ,

‘TKT_description’ => $descriptionEv,

‘TKT_price’=> $prixFinEv ,

‘TKT_qty’=> $quantEvBillet ,

‘TKT_start_date’ => $startDateEv,

‘TKT_end_date’ => $endDateEv,

‘TKT_taxable’ => true,

‘TKT_wp_user’ => $current_user->ID

//TKT_required

)
);
$TKT_ID=$new_ticket->save();

$new_datetime_ticket=EE_Datetime_Ticket::new_instance(
array(
‘DTT_ID’=> $DDT_ID , // Datetime ID related to the EVT_ID
‘TKT_ID’=> $TKT_ID
)
);

$DKT_ID=$new_datetime_ticket->save();

$data[‘id’]=$EVT_ID;
header(‘Content-type: application/json’);
echo json_encode($data);
?>

It’s work perfectly but the problem is that the price of the ticket is 0 when i check in the permalink event, here’s a link

https://www.agendatickets.com/?post_type=espresso_events&p=16921

Thank’s


Josh

  • Support Staff

March 28, 2017 at 3:27 pm

Hi there,

I’m afraid the code you posted here lacks enough context for us to be able to give you any advice on how to fix this. It should be noted that we don’t really offer support for custom code here.

The developers may be able to give you a few ideas on where to fix your custom code if you can open an issue on Github and include more information and include the code in a larger context.


lexavss

March 28, 2017 at 3:42 pm

Thank you for your reply. We found the answer and solved the problem.
We put in place a front-end system on the addition of events and a management interface by organizer with statistics voila;)

Viewing 4 reply threads

The support post ‘EE_Ticket doens't save correctlly’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso