Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello Authors,

    I have faced the same issue for wc_customer_bought_product. After debugging your plugin code, found that there is one parameter missing in SQL.

    $result = $wpdb->get_var(
    $wpdb->prepare( “
    SELECT 1 FROM {$wpdb->posts} AS p
    INNER JOIN {$wpdb->postmeta} AS pm ON p.ID = pm.post_id
    INNER JOIN {$wpdb->prefix}woocommerce_order_items AS i ON p.ID = i.order_id
    INNER JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS im ON i.order_item_id = im.order_item_id
    WHERE p.post_status IN ( ‘wc-completed’, ‘wc-processing’ )
    AND pm.meta_key IN ( ‘_billing_email’, ‘_customer_user’ )
    AND im.meta_key IN ( ‘_product_id’, ‘_variation_id’ )
    AND im.meta_value = %d
    “, $product_id
    ) . ” AND pm.meta_value IN ( ‘” . implode( “‘,'”, $customer_data ) . “‘ )”
    );

    SELECT 1 should be replaced with SELECT COUNT( DISTINCT i.order_item_id ).

    I hope we will get this fixed as soon as possible.

    tushar_solace

    (@tushar_solace)

    Hello Plugin authors,

    I faced the same issue. While debugging found that there is problem with postid passed on line 114. sometimes instead of postid an object is passed through $arg[0].

    Please have check and provide a bug fixed version of group.

    Hope my comments will help.

    Thanks,
    Tushar.

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