CSV import issue

Home Forums Calendar Products Events Calendar PRO CSV import issue

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1022166
    Steven Nguyen
    Participant

    I have several events with the same name and time, but different venues. I’ve been uploading the events using separate excel files for events against each venue. When I upload one batch of events for a particular venue, and then upload a second set of events for the next venue, the previously uploaded set of events are overwriting the first set of events with new venue information.

    Is there any way to get around this short of renaming each event?

    #1022290
    Nico
    Member

    Howdy Casey,

    Welcome to our support forums and thanks for reaching out to us. I’ll try to help you here!

    Unfortunately there’s no ‘clean’ way to hook and prevent the check for existing posts. But there’s one ‘not so clean’ solution you might want to try before considering this as not possible. The function that looks for an existing event makes use of get_posts/kbd> which we can 'hijack' to make it always return no matches with the following code:

    /* Only activate this snippet before importing, and make sure to deactivate it after the import is done */
    add_filter( 'posts_search', 'hijack_filter_query_for_title_search', 15 );
    function hijack_filter_query_for_title_search( $search ) {
    global $wpdb;
    $search .= $wpdb->prepare( " AND {$wpdb->posts}.post_title=%s", 'xxxx' );
    return $search;
    }

    Do you understand what the code will be doing ? I'm sorry there's no 'correct' way of doing this, but I guess this workaround might help you out. Please let me know if it does indeed,
    Best,
    Nico

    #1075440
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘CSV import issue’ is closed to new replies.