• I know it sounds weird,

    But I already made all the tests and I’m 100% sure that when I Update elementor 2.1.6 > 2.2.1 it makes my filters in Woocommerce Orders Admin Page stops working.

    Any idea about the reason of that?

    This is the code of the Filter in my Woocommerce Page (stopped working after the update)

    /*
    * Monta select de frequencia de pedido e exibe na listagem de pedidos no painel administrador do wc
    */
    function select_meta_frequencia( $post_type ) {

    // verifica se é listagem de pedidos
    if( $post_type == ‘shop_order’ ) {

    // monta select
    echo ‘<select name=”filtro_frequencia”>’;

    echo ‘<option value=”0″ ‘.($_GET[‘filtro_frequencia’] == 0 ? “selected” : “”).’>Todos</option>’;
    echo ‘<option value=”1″ ‘.($_GET[‘filtro_frequencia’] == 1 ? “selected” : “”).’>Aulas</option>’;
    echo ‘<option value=”2″ ‘.($_GET[‘filtro_frequencia’] == 2 || !isset($_GET[‘filtro_frequencia’]) ? “selected” : “”).’>Loja</option>’;

    echo ‘</select>’;

    }

    }
    add_action( ‘restrict_manage_posts’, ‘select_meta_frequencia’ );

    function add_join_meta_pedido( $clause=” ) {

    global $wpdb, $pagenow;

    // entrou na pagina de listagem de pedidos
    if ( is_admin() && $pagenow==’edit.php’ && $_GET[‘post_type’] == ‘shop_order’) {

    // nao foi definida frequencia? é a primeira requisicao (entao todas as op??es de frequencia têm que ter valor)
    if( isset($_GET[‘filtro_frequencia’]) && $_GET[‘filtro_frequencia’] != ”) {

    // mostra os que tem frequencia
    if($_GET[‘filtro_frequencia’] == 1) {

    $clause .= ” INNER JOIN $wpdb->postmeta AS my_postmeta ON ($wpdb->posts.ID = my_postmeta.post_id AND my_postmeta.meta_key = ‘frequencia’) “;

    }
    // oculta os que tem frequencia
    else if($_GET[‘filtro_frequencia’] == 2) {

    $clause .= ” LEFT JOIN $wpdb->postmeta AS my_postmeta ON ($wpdb->posts.ID = my_postmeta.post_id AND my_postmeta.meta_key = ‘frequencia’) “;

    add_filter( ‘posts_where’, ‘add_where_meta_pedido’ );

    }
    // ambos
    else {

    return $clause;

    }

    }
    // primeira requisi??o, default é ocultar pedidos com frequencia
    else {

    $clause .= ” LEFT JOIN $wpdb->postmeta AS my_postmeta ON ($wpdb->posts.ID = my_postmeta.post_id AND my_postmeta.meta_key = ‘frequencia’) “;

    add_filter( ‘posts_where’, ‘add_where_meta_pedido’ );

    }

    }

    return $clause;

    }
    add_filter( ‘posts_join’, ‘add_join_meta_pedido’ );

    function add_where_meta_pedido( $clause=” ) {

    $clause .= ” AND ( my_postmeta.meta_id IS NULL ) “;

    return $clause;

    }

    Tks a lot

Viewing 2 replies - 1 through 2 (of 2 total)
  • @dimbert Hi, we can’t reproduce this issue.

    It is working when you deactivate Elementor?

    Can you share a screenshot to this page so I can have a closer look?

    Thread Starter dimbert

    (@dimbert)

    Hi.

    First of all Tks for answering.

    I’m not sure What kind of screenshot do you need or I can create to show the problem… The problem is that a Filter that I created stop working as it should.

    I made more tests and I’m convinced that some code added between 2.1.6 to 2.2.1 makes my filter stop working.

    My new Tests:

    (WP + Woocommerce + My Filter + Elementor 2.1.6) = Working Great!
    (WP + Woocommerce + My Filter + Elementor 2.2.1) = Filter not working
    (WP + Woocommerce + My Filter + Elementor 2.1.6 then upgrading to 2.2.1) = Filter not working

    Can you please check if my Filter Code showed in the 1st post, conflicts with something in Elementor? Or do you know a way that I can troubleshoot this?

    Tks a lot

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Updating 2.1.6 to 2.2.1 crashes my Filters in the Woocommerce Orders Page’ is closed to new replies.