Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM › Number of products on store listing page
- This topic has 5 replies, 3 voices, and was last updated 4 years, 9 months ago by WCFM Forum.
- AuthorPosts
- October 2, 2019 at 12:30 pm #84753CommunityCoralsParticipant
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
DominiqueAttachments:
You must be logged in to view attached files. - October 11, 2019 at 9:39 am #86166WCFM ForumMember
HI,
Well, this information showing by custom code.
Can you share that code with me, it needs to be changed!
Thank You
- October 11, 2019 at 4:06 pm #86306CommunityCoralsParticipant
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 ); - October 14, 2019 at 11:19 am #86754WCFM ForumMember
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
- January 15, 2020 at 9:55 am #102098Auhouse.ruParticipant
Added code. He does not work
- February 7, 2020 at 11:39 am #106041WCFM ForumMember
Add this code instead –
add_filter( 'wcfm_is_allow_store_list_product_count', '__return_true' );
Thank You
- AuthorPosts
- The topic ‘Number of products on store listing page’ is closed to new replies.