Banner Logo

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

Show a list of all vendors

WCMp Core

Tagged: , ,

Resolved
Viewing 8 reply threads
  • Author
    Posts
    • #122988
      Yoni Lewis
      Participant

      Hi: I am using your plugin and it is great. I would need to know if there is any opton or shotcode, to Show a list of all vendors (the list could include name, logo or avatar, etc.)?
      Or how could be added?
      Thks!

    • #122997

      Hi @yonilewis thank you for getting in touch with us .Yes, we have a shortcode that creates a vendor list page [wcmp_vendorslist orderby=”registered” order=”ASC”].
      Using this customer can search the vendors , to have an idea you can check our demo page: http://wcmpdemos.com/all-in-one-demo/vendors/
      Let us know if you need any further help.

    • #123031
      Yoni Lewis
      Participant

      Hi: thks a lot for your fast reply. And as for categories, those on left are woocomemrce product categories? Any way to set Vendors categories, related to their areas of interest?
      Thks again…

    • #123036

      yes we can use a shortcode to display the product category added by the vendors
      [wcmp_product_category vendor=”” per_page=”12″ columns=”4″ orderby=”title” order=”DESC” category=”” operator=”IN”]
      In case we want to add multiple categories , then we separate it by a “ comma “
      For better understandings please go through our documentation on shortcodes
      https://multivendorx.com/list-of-shortcodes/

    • #123123
      Yoni Lewis
      Participant

      Hi: In reply to your post, I would need to know to do this…

      – when I enter a woocommerce category, I see the products. I would like to see there the Vendors, organized by category. How to do that?

      Thks…

    • #123152

      you can set vendor list page with category sorting using [wcmp_vendorslist orderby=”category”]. However, the users still need to select the categories.
      Now, if you want to specify the categories for each vendor list page, then you have to do custom code. For this, you need to use this filter : apply_filters(‘wcmp_vendor_list_get_wcmp_vendors_args’, $query, $order_by, $_REQUEST, $atts);
      and add your custom code.

    • #123153

      Hi, you can use this code in your current active theme functions.php file. Then define “category” attribute with vendor list shortcodecode. See this link: https://prnt.sc/pnxx92

      /**** Add category attribute on vendor list shortcode *****/
      add_filter('wcmp_vendor_list_get_wcmp_vendors_args', 'wcmp_vendor_list_shortcode_category_attribute' , 10 , 4 );
      function wcmp_vendor_list_shortcode_category_attribute( $query, $order_by, $qst, $atts ){
         if( empty( $atts ) ) return $query;
         $block_vendors = wp_list_pluck(wcmp_get_all_blocked_vendors(), 'id');
         $include_vendors = array();
         $pro_args = array(
            'posts_per_page' => -1,
            'post_type' => 'product',
            'tax_query' => array(
               array(
                  'taxonomy' => 'product_cat',
                  'terms' => array_map('sanitize_title', explode(',',$atts['category'])),
                  'field' => 'slug',
                  'operator' => 'IN'
                  )
               )
            );
         $products = get_posts($pro_args);
         $product_ids = wp_list_pluck($products, 'ID');
         foreach ($product_ids as $product_id) {
            $vendor = get_wcmp_product_vendors($product_id);
            if ($vendor && !in_array($vendor->id, $block_vendors)) {
               $include_vendors[] = $vendor->id;
            }
         }
         $query['include'] = $include_vendors;
         return $query;
      }
      Copy
    • #123161
      Yoni Lewis
      Participant

      Hi: thks a lot for your fast and perfect reply!!!
      🙂

    • #123163

      @Yoni Lewis, we are happy to help you out.

      We would love it if you shared your experience by giving us 5/5 review here : https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/reviews/#new-post
      Seeing glowing reviews from existing customers makes others more comfortable knowing they’ll get the support they need should an issue with our services arise.

Viewing 8 reply threads

The topic ‘Show a list of all vendors’ is closed to new replies.