• Resolved misstest

    (@misstest)


    when instructor is using the “Add to store” option, it lists all the products from admin and all instructor products.
    can it be limited to show/add only admin created products?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author WC Lovers

    (@wclovers)

    HI,

    Yeah sure, possible!

    Please know me your site’s Admin accounts Ids.

    Thank You

    Thread Starter misstest

    (@misstest)

    Great!!

    ID: 1

    Plugin Author WC Lovers

    (@wclovers)

    Thanks, please add this code to your site for the purpose –

    add_filter( 'wcfm_sell_items_catalog_args', function( $args ) {
    	if( isset( $args['author__not_in']  ) ) unset( $args['author__not_in']  );
    	$args['author'] = 1; 
    	return $args;
    }, 50 );
    add_filter( 'wcfmmp_is_allow_single_product_multivendor_by_product', function( $is_allow, $product_id ) {
    	global $WCFM, $WCFMmp, $product, $post;
    	
    	$product_author = wcfm_get_vendor_id_by_post( $product_id );
    	if( $product_author ) {
    		$is_allow = false;
    	}
    	return $is_allow;
    }, 50, 2 );

    Add this code to your child theme’s functions.php
    In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/

    Thank You

    Thread Starter misstest

    (@misstest)

    Thank you so much!!! 🙂

    Plugin Author WC Lovers

    (@wclovers)

    You are welcome 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Add only admin products’ is closed to new replies.