Banner Logo

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

Issue on Vendor view with latest update

WCMp Core

Resolved
Viewing 4 reply threads
  • Author
    Posts
    • #114045
      redilson
      Participant

      Hi WCMP team,

      There’s an issue on the WCMP > Vendors page. The Products column is incorrect, showing thousands of products for vendors. If you click the link, it no longer takes you to their products. Thanks for the assistance.

    • #114047
      redilson
      Participant

      This is occurring in the latest version. If I revert to 3.5.15, it goes back to normal.

    • #114102

      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
    • #114131
      redilson
      Participant

      Thank you. You can close this if it’ll be fixed in the next update.

    • #114150

      Thank you @redilson, based on your confirmation we are marking this thread closed.

      Regards,

Viewing 4 reply threads

The topic ‘Issue on Vendor view with latest update’ is closed to new replies.