WPSolr not replacing WP_Query

  • cbarwin
    Participant
    # 4 months, 1 week ago

    I’ve embedded a basic search form on standard WordPress page (not a WooCommerce shop page, category page, etc.).

    I’m initiating the query below on document load via AJAX. WPSolr is not replacing the query. The search is taking several minutes to complete.

    You can see an example here:
    https://s41tradeconnect.com/my-account/trade-connect/all-products/create-new-product-2-4/

    $args = array(
    ‘meta_query’ => array(
    array(
    ‘key’ => ‘_sku’,
    ‘value’ => ‘k2214’,
    ‘compare’ => ‘LIKE’
    )
    ),
    ‘post_type’ => ‘product_variation’,
    ‘posts_per_page’ => -1,
    );

    $query = new WP_Query( $args );

    If I enable WooCommerce on the page, it fails with the error below.

    Here’s a duplicate page with WooCommerce enabled:
    https://s41tradeconnect.com/my-account/trade-connect/all-products/create-new-product-2-4-2/

    component: “Plugin: woocommerce”
    file: “wp-includes/class-wp-query.php”
    key: “60b199856825376f07d8c6ebb8be9106”
    line: 4046
    message: “Trying to get property ‘post_title’ of non-object”
    stack: Array(10)
    0: “WP_Query->is_page()”
    1: “is_page()”
    2: “is_shop()”
    3: “wpsolr\\p\\e\\w\\WPSOLR_Plugin_WooCommerce->is_product_category_url()”
    4: “wpsolr\\p\\e\\w\\WPSOLR_Plugin_WooCommerce->get_is_category_search()”
    5: “wpsolr\\p\\e\\w\\WPSOLR_Plugin_WooCommerce->wpsolr_filter_is_replace_by_wpsolr_query()”
    6: “apply_filters(‘wpsolr_filter_is_replace_by_wpsolr_query’)”
    7: “wpsolr\\c\\c\\s\\WPSOLR_Service_Container::get_is_replace_by_wpsolr_query()”
    8: “wpsolr\\c\\c\\s\\WPSOLR_Service_Container::action_wp_loaded()”
    9: “do_action(‘wp_loaded’)”

    wpsolr
    Keymaster
    # 4 months, 1 week ago

    WPSOLR only replaces WordPress archive page queries: search, taxonomies, post types …

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.