Banner Logo

Be a part of the family: Connect, Receive Support,
Contribute, and Reap Abundant Rewards!

Errors in the number of products from sellers

General Marketplace Discussion (User’s interaction forum)

Resolved
Viewing 2 reply threads
  • Author
    Posts
    • #114005
      kevajo
      Participant

      The number of products of the sellers display high number, among all the sellers the number display more than 3000 products yet in reality this is not the case.
      Here is the catch

    • #114103

      Hi,
      We have found this issue on our end. will fix on our next update.
      kindly follow this link to track the issue – https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/issues/635

      Please add this code in the function.php of the current active theme :

      add_filter( 'wcmp_get_products_ids','Wcmp_minor_bug_temporary_fix', 10 , 3);
      function Wcmp_minor_bug_temporary_fix($result, $clauses, $id){
      	global $wpdb;
      	$term_id =  get_user_meta($id, '_vendor_term_id', true);
              $default_clauses = array(
                  'fields'    => $wpdb->prefix.'posts.ID',
                  'where'     => "AND ".$wpdb->prefix."posts.post_status = 'publish' ",
                  'groupby'   => $wpdb->prefix.'posts.ID',
                  'orderby'   => $wpdb->prefix.'posts.post_date DESC',
                  'limits'    => ''
              );
              $clauses = apply_filters( 'wcmp_get_products_ids_clauses_request', wp_parse_args( $clauses, $default_clauses ) );
              $fields   = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
              $where    = isset( $clauses['where'] ) ? $clauses['where'] : '';
              $groupby  = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';
              $orderby  = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';
              $limits   = isset( $clauses['limits'] ) ? $clauses['limits'] : '';
              $sql = "SELECT
                      $fields
                  FROM
                      {$wpdb->prefix}posts
                  LEFT JOIN {$wpdb->prefix}term_relationships ON(
                          {$wpdb->prefix}posts.ID = {$wpdb->prefix}term_relationships.object_id
                      )
                  LEFT JOIN {$wpdb->prefix}term_taxonomy ON(
                      {$wpdb->prefix}term_relationships.term_taxonomy_id = {$wpdb->prefix}term_taxonomy.term_taxonomy_id
                  )
                  WHERE
                      1 = 1 AND(
                          {$wpdb->prefix}term_taxonomy.term_id IN( $term_id )
                      ) AND {$wpdb->prefix}posts.post_author IN( $id ) AND {$wpdb->prefix}posts.post_type = 'product' $where
                  GROUP BY
                      $groupby
                  ORDER BY
                      $orderby $limits";
      
      	return $result = $wpdb->get_results( $sql );
      }
      Copy

      Regards,

    • #117995

      We have not received any update from you for a long. Hope this ticket is already been resolved.

      We are now closing this ticket. Kindly create a new one if you need any further help.

Viewing 2 reply threads

The topic ‘Errors in the number of products from sellers’ is closed to new replies.