Banner Logo

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

Show hidden products on vendor shop pages

WCMp Core

Resolved
Viewing 29 reply threads
  • Author
    Posts
    • #128601
      ig
      Participant

      I’m using ReHub theme and allow Allow multiple vendors to sell the same product – Single Product Multiple Vendors (SPMV) is checked.

      ReHub theme has the function “Woocommerce -> Status -> Tools -> Hide button for ‘Hide duplicated” is removing products with the same SKU. It works fine for product pages and category pages but also hide products on shop pages except for the one with the lowest price which is a problem.

      ReHub theme recommended ‘to ask authors of WCMP for a snippet how to show hidden products ONLY on store pages. They should have it.’

      Product visibility is WooCommerce taxonomy, so would it be possible to make use one of the WordPress’ hooks, most likely pre_get_posts or parse_query, to alter global query object and display products which are hidden (essentially belong to hidden categories) on shop pages like shop/shop1 (that is dc_vendor_shop taxonomy) ?

    • #128609

      Hi @Ivan Gacesa, we have forwaded this to our developers.
      They will get back to you soon.

    • #128644

      Hi,
      To show hidden product on shop page you can use below function to check is this a shop page or not.

      if (wcmp_is_store_page())
      Copy

      Kindly ask your theme developer to check the page before add their code.

      Regards,

    • #128739
      ig
      Participant

      Hi @Abhirup,

      Thank you for the answer, I asked theme developer and they sent

      ‘This function (wcmp_is_store_page()) can help you to show some information on store page, but it will not help to show hidden products, because product loop is controlled by plugin. You need to ask option to change product loop of store page (not just function to detect store page)’

      Which WordPress hooks can we use (pre_get_posts or parse_query, to alter global query object and display products which are hidden on shop pages?

    • #128749
      ig
      Participant

      Hi,

      Thank you for the zip file. This is wcmp plugin update or wcmp vendor membership plugin update?

      Do we need to install wcmp vendor membership plugin to show hidden products on vendor shop pages?

      Can we only add snippets for hidden products?

    • #128757

      Hi,
      Sorry for the inconvenience. There was a miscommunication.

      As per your requirement you have to use below action to change the query

      pre_get_posts
      Copy

      Regards,

    • #128759
      ig
      Participant

      Hi,

      It’s not necessary to install wcmp vendor membership plugin?

      Can you send the snippet for show hidden products for pre_get_posts?

      Regards

    • #128816

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

      function _additional_woo_query( $query ) {
          if ( wcmp_is_store_page() ) {
              $products = array();
              $store_id = wcmp_find_shop_page_vendor();
              $vendor = get_wcmp_vendor($store_id);
              $vendor_product_ids = wp_list_pluck( $vendor->get_products_ids(), 'ID' );
              if( isset($vendor_product_ids) && !empty($vendor_product_ids) ) {
                  $query->set('post__in',$vendor_product_ids );
              }
          } 
      }
      add_action( 'pre_get_posts', '_additional_woo_query', 999 );
      Copy

      Regards,

    • #128822
      ig
      Participant

      Hi Abhirup,

      Thank you for the snippet, but we have the same issue.

      There is one product with 2 prices from 2 vendors (shop pages). The product is displayed on the vendor shop page which has minimal price, on another shop page (who also sells this product with higher price) product is not displayed (it’s hidden with ReHub theme function “Woocommerce -> Status -> Tools -> Hide button for ‘Hide duplicated” is removing products with the same SKU.)

    • #128875

      Hi,
      The above code will help you to show the all products on vendor shop page.
      If this code is not working then please add your custom code. Using below filter you can change the product query.
      Kindly ask to your theme developer.

      Regards,

    • #128956
      ig
      Participant
      This reply has been marked as private.
    • #129025
      This reply has been marked as private.
    • #129048
      ig
      Participant
      This reply has been marked as private.
    • #129178
      This reply has been marked as private.
    • #129951
      ig
      Participant

      @Moumite do you have update from the team, expected time to resolve this?

    • #129967

      This is the response from the theme :

      “The code which you provided him is correct, we use similar in some of the functionality, but maybe he didn’t insert it properly ”

      Can you share a temporary admin, FTP access so we can check?
      While sharing the access, don’t forget to mark the response as private.

    • #129986
      ig
      Participant

      Hi @Moumita,

      Thanks for your reply. The code is inserted using Code Snippet plugin (see screenshot).

      Please read settings carefully (the first post in this topic), maybe issue is caused by hiding duplicate products (with the same SKU) on category pages.

      ReHub theme has the function “Woocommerce -> Status -> Tools -> Hide button for ‘Hide duplicated” is removing products with the same SKU. It works fine for product pages and category pages but also hide products on shop pages except for the one with the lowest price which is a problem.

      I can add an admin user for you, but just to be sure, this is not to disable all plugins and theme which you did it on another website.

    • #130024

      @Ivan Gacesa, yes please create a staging site and share the FTP, admin access.

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

    • #130067
      ig
      Participant
      This reply has been marked as private.
    • #130065
      ig
      Participant
      This reply has been marked as private.
    • #130066
      ig
      Participant
      This reply has been marked as private.
    • #130162
      This reply has been marked as private.
    • #130210
      This reply has been marked as private.
    • #130237
      ig
      Participant
      This reply has been marked as private.
    • #130315
      This reply has been marked as private.
    • #130402
      ig
      Participant
      This reply has been marked as private.
    • #130431
      This reply has been marked as private.
    • #130657
      This reply has been marked as private.
    • #130661
      ig
      Participant
      This reply has been marked as private.
    • #130720
      This reply has been marked as private.
Viewing 29 reply threads

The topic ‘Show hidden products on vendor shop pages’ is closed to new replies.