Claim your freedom to choose the perfect partner for your multi-vendor journey.

FREEDOM25

Celebrate the festive season by giving your marketplace a powerful lift!

FESTIVE20

5.0.0
Something big is coming for marketplace admins… MultiVendorX 5.0 is almost here. Are you ready?
Be the first to explore all the game-changing features!
Power your marketplace dreams with unbeatable Black Friday deals!

MVXBLACK30

Supercharge your marketplace vision with unstoppable Cyber Monday deals!

MVXCYBER30

Holiday cheer, bigger savings
Take 25% off-because your marketplace deserves a gift too.

happyholiday

View Categories

Users can only see products from their followed vendors on the shop page

Add the below code in the functions.php file of your current active theme –

add_action( 'woocommerce_product_query', 'custom_shop_query' );
function custom_shop_query( $q ) {
    // Check if we are on the shop page
    if ( is_shop() && $q->is_main_query() ) {
        $mvx_customer_follow_vendor = get_user_meta( get_current_user_id(), 'mvx_customer_follow_vendor', true ) ? get_user_meta( get_current_user_id(), 'mvx_customer_follow_vendor', true ) : array();
        $author_ids = array(); // Array to store author IDs
        foreach ($mvx_customer_follow_vendor as $vendor) {
            $author_ids[] = $vendor['user_id']; // Collect user IDs
        }
        $q->set( 'author__in', $author_ids );
    }
}

Leave a Reply

Shopping Cart
Scroll to Top