Number of products on store listing page

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM Number of products on store listing page

Viewing 5 reply threads
  • Author
    Posts
    • #84753
      AvatarCommunityCorals
      Participant

      Hello,

      the displayed number of products on store page is confusing for customers. I assume especially for archived products. I have vendors that have just archived and out of stock products. Still they have a huge number of products displayed to the customer on store listing. When customer goes to shop he doesn´t see any products.

      Would be great if we could just count items with stock > 0.

      Thanks & BR
      Dominique

      Attachments:
      You must be logged in to view attached files.
    • #86166
      WCFM ForumWCFM Forum
      Keymaster

      HI,

      Well, this information showing by custom code.

      Can you share that code with me, it needs to be changed!

      Thank You

    • #86306
      AvatarCommunityCorals
      Participant

      Hi,

      oh, you are right. Thought it would be standard by now. Below the snippet.

      add_action( ‘wcfmmp_store_list_after_store_info’, function( $store_id, $store_info ) {
      global $WCFM;
      $vendor_products = $WCFM->wcfm_vendor_support->wcfm_get_products_by_vendor( $store_id, ‘publish’ );
      if( !empty( $vendor_products ) ) {
      echo ‘<p class=”store-products” style=”display:block;margin-bottom:0px;position:absolute;top:13px;right:10px;color:#fff;background:#17a2b8;padding:0px 5px;border-radius:4px;”><i class=”wcfmfa fa-cube” aria-hidden=”true”></i> Angebote: <span style=”font-weight:600;font-size:18px;color:#ffffff;”>’ . count($vendor_products) . ‘</span></p>’;
      }
      }, 10, 2 );

    • #86754
      WCFM ForumWCFM Forum
      Keymaster

      Hi,

      Please add this code as well –

      add_filter( 'wcfm_products_by_vendor_args', function( $args ) {
      	$args['meta_query'][] = array(
      																'key' => '_stock_status',
      																'value' => 'instock',
      																'compare' => '=',
      															);
      	return $args;
      }, 50 );

      Well, this will work after WCFM next update.

      Thank You

    • #102098
      AvatarAuhouse.ru
      Participant

      Added code. He does not work

    • #106041
      WCFM ForumWCFM Forum
      Keymaster

      Add this code instead –

      add_filter( 'wcfm_is_allow_store_list_product_count', '__return_true' );

      Thank You

Viewing 5 reply threads
  • The topic ‘Number of products on store listing page’ is closed to new replies.