Support » Plugin: OpenTickets Community Edition » Alternative Dates Display

  • Hello, I was recently in touch asking how to show related events when you had selected date in the booking calendar on the event details page and was given the following queries to try:

    function get_other_events( $child_event_id, $limit ) {
      $child_event = get_post( $child_event_id );
    
      $other_child_events = get_posts( array(
        'post_type' => 'qsot-event',
        'post_status' => 'publish',
        'post_parent' => $child_event->post_parent,
        // events that start in the future
        'meta_query' => array(
          array(
            'key' => '_start',
            'value' => date( 'c' ), // now
            'compare' => '>',
          ),
        ),
        'meta_key' => '_start',
        'orderby' => 'meta_value',
        'meta_type' => 'DATETIME',
      ) );
    
      return $other_child_events;
    }

    and

    function get_other_events( $child_event_id, $limit ) {
      $child_event = get_post( $child_event_id );
      $event_area_id = get_post_meta( $child_event->ID, '_event_area_id', true );
    
      $other_child_events = get_posts( array(
        'post_type' => 'qsot-event',
        'post_status' => 'publish',
        // events that start in the future
        'meta_query' => array(
          array(
            'key' => '_event_area_id',
            'value' => $event_area_id,
          ),
          array(
            'key' => '_start',
            'value' => date( 'c' ), // now
            'compare' => '>',
          ),
        ),
        'meta_key' => '_start',
        'orderby' => 'meta_value',
        'meta_type' => 'DATETIME',
      ) );
    
      return $other_child_events;
    }

    but one returns the other events available and one returns no results at all. could you help?

Viewing 1 replies (of 1 total)
  • Plugin Author quadshot

    (@quadshot)

    Hi please know, due to unforseen circumstances this issue is in que to be addressed by our programmer. We thank you for your patience.

Viewing 1 replies (of 1 total)
  • The topic ‘Alternative Dates Display’ is closed to new replies.