Forum Replies Created
-
AuthorPosts
-
February 5, 2018 at 3:14 am in reply to: Strange interferences between start date and event-post date #1443965
valerio
ParticipantFriendly bump!
January 29, 2018 at 7:40 am in reply to: Strange interferences between start date and event-post date #1438858valerio
ParticipantHi Patricia,
Can you please provide a quick hack on this, just to correctly serve my client while waiting for the final fix in the new release?
Also a quick clue on how to proceed will be usefull.
Thanks
v.January 24, 2018 at 4:22 am in reply to: Strange interferences between start date and event-post date #1434484valerio
ParticipantFriendly bumb… so sorry…
January 23, 2018 at 2:25 am in reply to: Strange interferences between start date and event-post date #1433295valerio
ParticipantThis reply is private.
January 23, 2018 at 2:22 am in reply to: Strange interferences between start date and event-post date #1433293valerio
ParticipantThis reply is private.
January 23, 2018 at 2:18 am in reply to: Strange interferences between start date and event-post date #1433288valerio
ParticipantHi Patricia.
I’ve ran some tests and couldn’t reproduce the error with all Modern Tribe plugins installed and up-to-date.
My testing site is completely up to date.
To get started, can you please let is know when this issue started happening?
One of the last update. About on 16 Dec.
Have you just installed Event Tickets Plus for the first time and found this problem?
Site was correctly running from last spring.
Have you had the plugin installed for a long time and then this suddenly started happening out of nowhere?
See above.
Also, could you please enable WP_DEBUG and WP_DEBUG_LOG and share with us any messages you see while creating new events and tickets? All WP_DEBUG messages will be stored in a debug.log file in /wp-content.
Enabled yet. No errors.
I would also recommend you to open up your browser’s console and see if there are any relevant errors while creating new events and tickets. Identifying a specific error can help us research further.
I don’t see any error in the console.
Also, please share your system info with us.
In a private reply, with codes to access my test site.
VERY IMPORTANT: error happens only during the first edit.
So these are the two workflow in which you can reproduce the error:- Create the event (form filled, without saving);
- Create ticket;
- Save the event.
The start selling date of my ticket is changed in post creation date / time.
Same for event creation + edit:
1. Create event (form filled > publish);
2. Add ticket for the event > save ticket;
3. Edit / Save event
The start selling date of the ticket is changed in eventpost creation date / time.Thanks.
January 19, 2018 at 1:40 am in reply to: tribe_events_has_tickets_on_sale returns 0 during last sold day #1430276valerio
ParticipantSorry…
I cannot correctly paste my solution.
The file is attached.January 19, 2018 at 1:38 am in reply to: tribe_events_has_tickets_on_sale returns 0 during last sold day #1430272valerio
ParticipantIs there any developer out there?
I do not wish to be controversial.. but helpdesk should be able to understand this kind of problems at first glance.
Just control how the function is built…
I didn’t check in which part of the plugin the tribe_events_has_tickets_on_sale returns is used.
So I don’t now why it calculates the onSale status just using the day.
It could be a problem for a lastminute ticket platform where time is crucial.
If you look at the original MT code in
wp-content\plugins\event-tickets\src\template-tags\tickets.php
@ bout line 340 you’ll find start and end calculated without time:$now = current_time( 'timestamp' ); $start = strtotime( $ticket->start_date ); $finish = strtotime( $ticket->end_date );It means that $start and $finish variables are just the day of start and finish, without time.
The boolean is calculated here:$has_started = ( empty( $ticket->start_date ) || ( $start && $now > $start ) ); $not_ended = ( empty( $ticket->end_date ) || ( $finish && $now start_date ) && empty( $ticket->end_date ) ) { return true; } // Timestamps for comparison purposes: added time to be more accurate than the original MT function $timestart = $ticket->start_time; $timefinish = $ticket->end_time; $daystart = $ticket->start_date; $dayfinish = $ticket->end_date; $startdt = $daystart . ' ' . $timestart; $finishdt = $dayfinish . ' ' . $timefinish; $now = current_time( 'timestamp' ); $start = strtotime( $startdt ); $finish = strtotime( $finishdt ); // Are we within the applicable date range? $has_started = ( empty( $ticket->start_date ) || ( $start && $now > $start ) ); $not_ended = ( empty( $ticket->end_date ) || ( $finish && $now < $finish ) ); //what a mess? Don't worry: here you are all those pretty variables if you want to control vars content //echo $startdt; //echo $finishdt; //echo "inizio=" . $start . "<br>"; //echo "fine=" . $finish . "<br>"; //echo "adesso=" . $now . "<br>"; // Result return ( $has_started && $not_ended ); }}//end if
if ( ! function_exists( ‘tickit_events_has_tickets_on_sale’ ) ) {
/**
* Checks if the event has any tickets on sale
*
* @param int $event_id
*
* @return bool
*/
function tickit_events_has_tickets_on_sale( $event_id ) {
$has_tickets_on_sale = false;
$tickets = Tribe__Tickets__Tickets::get_all_event_tickets( $event_id );
foreach ( $tickets as $ticket ) {
$has_tickets_on_sale = ( $has_tickets_on_sale || tickit_events_ticket_is_on_sale( $ticket ) );
}return $has_tickets_on_sale; }}
Hope to be useful for those who wants to use the onsale function on their template for a more accurate calculation.
Maybe the original function is correct… As I said I didn’t check in which part of the plugin is used.
BYE
V.January 19, 2018 at 1:38 am in reply to: tribe_events_has_tickets_on_sale returns 0 during last sold day #1430271valerio
ParticipantIs there any developer out there?
I do not wish to be controversial.. but helpdesk should be able to understand this kind of problems at first glance.
Just control how the function is built…
I didn’t check in which part of the plugin the tribe_events_has_tickets_on_sale returns is used.
So I don’t now why it calculates the onSale status just using the day.
It could be a problem for a lastminute ticket platform where time is crucial.
If you look at the original MT code in
wp-content\plugins\event-tickets\src\template-tags\tickets.php
@ bout line 340 you’ll find start and end calculated without time:$now = current_time( 'timestamp' ); $start = strtotime( $ticket->start_date ); $finish = strtotime( $ticket->end_date );It means that $start and $finish variables are just the day of start and finish, without time.
The boolean is calculated here:$has_started = ( empty( $ticket->start_date ) || ( $start && $now > $start ) ); $not_ended = ( empty( $ticket->end_date ) || ( $finish && $now start_date ) && empty( $ticket->end_date ) ) { return true; } // Timestamps for comparison purposes: added time to be more accurate than the original MT function $timestart = $ticket->start_time; $timefinish = $ticket->end_time; $daystart = $ticket->start_date; $dayfinish = $ticket->end_date; $startdt = $daystart . ' ' . $timestart; $finishdt = $dayfinish . ' ' . $timefinish; $now = current_time( 'timestamp' ); $start = strtotime( $startdt ); $finish = strtotime( $finishdt ); // Are we within the applicable date range? $has_started = ( empty( $ticket->start_date ) || ( $start && $now > $start ) ); $not_ended = ( empty( $ticket->end_date ) || ( $finish && $now < $finish ) ); //what a mess? Don't worry: here you are all those pretty variables if you want to control vars content //echo $startdt; //echo $finishdt; //echo "inizio=" . $start . "<br>"; //echo "fine=" . $finish . "<br>"; //echo "adesso=" . $now . "<br>"; // Result return ( $has_started && $not_ended ); }}//end if
if ( ! function_exists( ‘tickit_events_has_tickets_on_sale’ ) ) {
/**
* Checks if the event has any tickets on sale
*
* @param int $event_id
*
* @return bool
*/
function tickit_events_has_tickets_on_sale( $event_id ) {
$has_tickets_on_sale = false;
$tickets = Tribe__Tickets__Tickets::get_all_event_tickets( $event_id );
foreach ( $tickets as $ticket ) {
$has_tickets_on_sale = ( $has_tickets_on_sale || tickit_events_ticket_is_on_sale( $ticket ) );
}return $has_tickets_on_sale; }}
Hope to be useful for those who wants to use the onsale function on their template for a more accurate calculation.
Maybe the original function is correct… As I said I didn’t check in which part of the plugin is used.
BYE
V.January 19, 2018 at 1:36 am in reply to: tribe_events_has_tickets_on_sale returns 0 during last sold day #1430268valerio
ParticipantIs there any developer out there?
I do not wish to be controversial.. but helpdesk should be able to understand this kind of problems at first glance.
Just control how the function is built…
I didn’t check in which part of the plugin the tribe_events_has_tickets_on_sale returns is used.
So I don’t now why it calculates the onSale status just using the day.
It could be a problem for a lastminute ticket platform where time is crucial.
If you look at the original MT code in
wp-content\plugins\event-tickets\src\template-tags\tickets.php
@ bout line 340 you’ll find start and end calculated without time:$now = current_time( 'timestamp' ); $start = strtotime( $ticket->start_date ); $finish = strtotime( $ticket->end_date );It means that $start and $finish variables are just the day of start and finish, without time.
The boolean is calculated here:$has_started = ( empty( $ticket->start_date ) || ( $start && $now > $start ) ); $not_ended = ( empty( $ticket->end_date ) || ( $finish && $now start_date ) && empty( $ticket->end_date ) ) { return true; } // Timestamps for comparison purposes: added time to be more accurate than the original MT function $timestart = $ticket->start_time; $timefinish = $ticket->end_time; $daystart = $ticket->start_date; $dayfinish = $ticket->end_date; $startdt = $daystart . ' ' . $timestart; $finishdt = $dayfinish . ' ' . $timefinish; $now = current_time( 'timestamp' ); $start = strtotime( $startdt ); $finish = strtotime( $finishdt ); // Are we within the applicable date range? $has_started = ( empty( $ticket->start_date ) || ( $start && $now > $start ) ); $not_ended = ( empty( $ticket->end_date ) || ( $finish && $now < $finish ) ); //what a mess? Don't worry: here you are all those pretty variables if you want to control vars content //echo $startdt; //echo $finishdt; //echo "inizio=" . $start . "<br>"; //echo "fine=" . $finish . "<br>"; //echo "adesso=" . $now . "<br>"; // Result return ( $has_started && $not_ended ); }}//end if
if ( ! function_exists( ‘tickit_events_has_tickets_on_sale’ ) ) {
/**
* Checks if the event has any tickets on sale
*
* @param int $event_id
*
* @return bool
*/
function tickit_events_has_tickets_on_sale( $event_id ) {
$has_tickets_on_sale = false;
$tickets = Tribe__Tickets__Tickets::get_all_event_tickets( $event_id );
foreach ( $tickets as $ticket ) {
$has_tickets_on_sale = ( $has_tickets_on_sale || tickit_events_ticket_is_on_sale( $ticket ) );
}return $has_tickets_on_sale; }}
Hope to be useful for those who wants to use the onsale function on their template for a more accurate calculation.
Maybe the original function is correct… As I said I didn’t check in which part of the plugin is used.
BYE
V.January 19, 2018 at 1:31 am in reply to: tribe_events_has_tickets_on_sale returns 0 during last sold day #1430265valerio
ParticipantIs there any developer out there?
I do not wish to be controversial.. but helpdesk should be able to understand this kind of problems at first glance.
Just control how the function is built…
I didn’t check in which part of the plugin the tribe_events_has_tickets_on_sale returns is used.
So I don’t now why it calculates the onSale status just using the day.
It could be a problem for a lastminute ticket platform where time is crucial.
If you look at the original MT code in
wp-content\plugins\event-tickets\src\template-tags\tickets.php
@ bout line 340 you’ll find start and end calculated without time:$now = current_time( 'timestamp' ); $start = strtotime( $ticket->start_date ); $finish = strtotime( $ticket->end_date );It means that $start and $finish variables are just the day of start and finish, without time.
The boolean is calculated here:$has_started = ( empty( $ticket->start_date ) || ( $start && $now > $start ) ); $not_ended = ( empty( $ticket->end_date ) || ( $finish && $now start_date ) && empty( $ticket->end_date ) ) { return true; } // Timestamps for comparison purposes: added time to be more accurate than the original MT function $timestart = $ticket->start_time; $timefinish = $ticket->end_time; $daystart = $ticket->start_date; $dayfinish = $ticket->end_date; $startdt = $daystart . ' ' . $timestart; $finishdt = $dayfinish . ' ' . $timefinish; $now = current_time( 'timestamp' ); $start = strtotime( $startdt ); $finish = strtotime( $finishdt ); // Are we within the applicable date range? $has_started = ( empty( $ticket->start_date ) || ( $start && $now > $start ) ); $not_ended = ( empty( $ticket->end_date ) || ( $finish && $now < $finish ) ); //what a mess? Don't worry: here you are all those pretty variables if you want to control vars content //echo $startdt; //echo $finishdt; //echo "inizio=" . $start . "<br>"; //echo "fine=" . $finish . "<br>"; //echo "adesso=" . $now . "<br>"; // Result return ( $has_started && $not_ended ); }}//end if
if ( ! function_exists( ‘tickit_events_has_tickets_on_sale’ ) ) {
/**
* Checks if the event has any tickets on sale
*
* @param int $event_id
*
* @return bool
*/
function tickit_events_has_tickets_on_sale( $event_id ) {
$has_tickets_on_sale = false;
$tickets = Tribe__Tickets__Tickets::get_all_event_tickets( $event_id );
foreach ( $tickets as $ticket ) {
$has_tickets_on_sale = ( $has_tickets_on_sale || tickit_events_ticket_is_on_sale( $ticket ) );
}return $has_tickets_on_sale; }}
Hope to be useful for those who wants to use the onsale function on their template for a more accurate calculation.
Maybe the original function is correct… As I said I didn’t check in which part of the plugin is used.
BYE
V.January 15, 2018 at 2:26 pm in reply to: tribe_events_has_tickets_on_sale returns 0 during last sold day #1426941valerio
ParticipantHi Jamie,
I don’t want to customize anything: my project is online and it works from last summer… so I’m not talking about a beta project.
I’m just wondering why a non-custimized fuction such as tribe_events_has_tickets_on_sale stopped to work since last plugin update.
In fact my site was working very well until last Events Ticket release.
I’m using tribe_events_has_tickets_on_sale on my template for a simple conditional formatting (icons thumbs and a specific style for events that are actually for sale) and I didn’t hack anything in the event tickets core.My event:
1. Is avilable (1 or more places available)
2. Can be sold (today is between the two dates picked in the ticket options)
But… the function returns 1 (true) till the last day… then it gives me 0 (false).For example:
MYevent
Availability: 10 places
start sell: 01/01/2018 h21:00
end sell: 15/01/2018 h20:00
The function returns 1 as expected until 14/01/2018 @23:59, then on 15/01/2018 00:00 it returns 0.
Any idea about that?Thanks.
ValerioJanuary 15, 2018 at 6:15 am in reply to: tribe_events_has_tickets_on_sale returns 0 during last sold day #1426467valerio
ParticipantFriendly bumb… sorry… 😉
valerio
ParticipantSo all the features will be ok on my develope site?
Thanks!
V.valerio
Participantps. This is my condition: at the moment both the most important functions of your plugin don’t work for me.
1. I cannot receive ticket mails;
2. The system doesn’t correctly manage quantities…
It’s more than frustrating.Thanks.
V. -
AuthorPosts
