Vendor List Widget Questions

General Marketplace Discussion (User’s interaction forum)

Vendor List Widget Questions Open

Tagged: 

Viewing 18 reply threads
  • Author
    Posts
    • #84949
      kimbess1
      Participant

      Hi friends,

      I am trying to add the snippet that’s removes vendor’s with no products (below) into my vendor-list.php page. However, I only know enough to get into trouble. Exactly where do I place the code within the code that’s already there to make it work? So far I’ve found all the ways that it doesn’t work, lol.

      /**
      ** Hide zero product vendor on wcmp vendor list widget
      **/
      add_filter(‘wcmp_widget_vendor_list_query_args’,’wcmp_hide_zero_product_vendor_on_vendor_list_widget’);
      function wcmp_hide_zero_product_vendor_on_vendor_list_widget($vendor_ids){
      $array_value = array();
      $get_vendor = get_wcmp_vendors($vendor_ids);
      $block_vendors = wp_list_pluck(wcmp_get_all_blocked_vendors(), ‘id’);
      foreach ($get_vendor as $key => $value) {
      $vendor = get_wcmp_vendor($value->id);
      $vendor_products = $vendor->get_products();
      if (empty($vendor_products)){
      $array_value[] = $value->id;
      }
      }
      $marge_block_and_zero_product_vendor = array_merge($array_value,$block_vendors);
      $vendor_ids[‘exclude’] = $marge_block_and_zero_product_vendor;
      return $vendor_ids;
      }

      Next question:

      I don’t want the small image showing in the Vendor List Widget. I changed the image height to 0px, but what can I change/remove in the code to make the removal cleaner?

      Thanks in advance!

    • #85027

      Hi @kimbess1, thanks for getting in touch with us.

      You need to add this code to the function.php of the current active theme. Hence you need to access you ftp, and goto to the current active theme folder. In that folder, you can see the function.php file. There you need to add the code.

    • #85056
      kimbess1
      Participant

      Hi Moumita,

      Yes, I understand that part. However, I don’t code. I don’t know where to add the code inside functions.php. I’ve tried it before/after different things and I can’t get it to work right. Please tell me where exactly to insert the code. Even better, please add an image of the functions.php code with this code inserted. Thanks so much!

    • #85171
      susmita
      Moderator

      @Kimbess1, not to worry.

      Can you please share with us the site url and a temporary admin, ftp access. We will paste the code in your site.

      While sharing the access, don’t forget to mark the response as private.

      Looking forward towards your co-operation regarding the same.

    • #85179
      kimbess1
      Participant
      This reply has been marked as private.
    • #85366
      susmita
      Moderator
      This reply has been marked as private.
    • #85383
      kimbess1
      Participant
      This reply has been marked as private.
    • #85511
      susmita
      Moderator

      @ Kimbess1,

      Your ftp access is not working.
      Can you please check!!

    • #85521
      kimbess1
      Participant

      Hi Susmita,

      I’m sorry. I just can’t make the ftp work. It’s been so long and my host company’s instructions are not helping. I’ve pasted the code below. Please just tell me where to insert the code.

      Thank you!

      <?php
      /**
      * The template for displaying demo plugin content.
      *
      * Override this template by copying it to yourtheme/dc-product-vendor/widget/vendor-list.php
      *
      * @author WC Marketplace
      * @package dc-product-vendor/Templates
      * @version 0.0.1
      */

      global $WCMp;

      $vendor_count = count($vendors); ?>
      <div id=”wcmp_widget_vendor_search” class=”vendor_search_wrap”>
      <?php wp_nonce_field( ‘wcmp_widget_vendor_search_form’, ‘wcmp_vendor_search_nonce’ ); ?>
      <input type=”search” class=”search_keyword search-field” placeholder=”<?php echo __(‘Search Vendor…’, ‘dc-woocommerce-multi-vendor’); ?>” value=”” name=”s” style=”width: 100%;margin-bottom: 10px;”>
      </div>

      <?php
      if($vendor_count > 5 ) { ?>
      <div id=”wcmp_widget_vendor_list” style=”height: 308px; overflow-y: scroll; width: 226px;” >
      <?php } else {?>
      <div id=”wcmp_widget_vendor_list” style=” height: auto; width: 226px;” >
      <?php }
      if($vendors) {
      foreach($vendors as $vendors_key => $vendor) {
      $vendor->image = $vendor->get_image() ? $vendor->get_image() : $WCMp->plugin_url . ‘assets/images/WP-stdavatar.png’;
      ?>
      <div style=” width: 100%; margin-bottom: 5px; clear: both; display: block;”>
      <div style=” width: 25%; display: inline;”>
      image; ?> id=”vendor_image_display”>
      </div>
      <div style=” width: 75%; display: inline; border-bottom: #ce9382 solid 1px; padding: 10px 10px 0px 10px;”>
      permalink ); ?>”>
      <?php echo $vendor->page_title; ?>

      </div>
      </div>

      <?php }
      }?>
      </div>

    • #85522
      kimbess1
      Participant
      This reply has been marked as private.
    • #85620
      This reply has been marked as private.
    • #85681
      kimbess1
      Participant

      Hi Moumita,

      The code changed the store name from the username to “Store 1”, but it still remains appearing on the widget even though it has no products.

    • #85768

      @kimbess1, can you share temporary admin access, so I can check.

      While sharing the access, don’t forget to mark the response as private.

    • #86025
      kimbess1
      Participant
      This reply has been marked as private.
    • #86061
      This reply has been marked as private.
    • #86112
      kimbess1
      Participant
      This reply has been marked as private.
    • #86181
      This reply has been marked as private.
    • #86250
      kimbess1
      Participant

      Yes, thank you, that worked great!

    • #86300
      susmita
      Moderator

      @ Kimbess1, great to know that.

      I hope you are satisfied with our assistance and plugin.

      A 5/5 review here-

      https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/reviews/#new-post , would be a great way to share your experience with others.
      This motivates us to continue providing the best experience possible and also helps others know how WC-Marketplace can make their life easier.

Viewing 18 reply threads

Please LOGIN to reply to this topic

WCMp bundle is available at a slashed price

Grab It Now