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

    (@wclovers)

    Hi,

    Do you mean post or WooCommerce Product categories?

    If it’s WC Product categories, then off course admin can control allowed categories for vendors.

    But this feature comes with WCfM Ultimate.

    Thank You

    Thread Starter wpbetsy

    (@wpbetsy)

    I mean the “Article” part, that’s the post categories.

    Plugin Author WC Lovers

    (@wclovers)

    Hi,

    I am afraid to say WCfM has no such capability option to restrict Article Categories.

    Don’t worry, we will add this option in very near future.

    Thanks for the request ??

    Thread Starter wpbetsy

    (@wpbetsy)

    I see the plugin is updated but I find nowhere I can restrict Article Categories. Where is it?

    Plugin Author WC Lovers

    (@wclovers)

    Hi,

    WCfM limit and restriction capabilities are part of WCfM Ultimate.

    You are allowed to limit –

    No. of Articles
    NO. of Products
    NO. of Gallery Images
    No. of Featured Products
    NO. of Customers

    Article Categories
    Product Categories

    Unfortunately, these are not part of WCFM Free version.

    Thank You

    Thread Starter wpbetsy

    (@wpbetsy)

    You just told me that you will add the restrict Article Categories soon and now you told me that it’s not available in free version.

    Plugin Author WC Lovers

    (@wclovers)

    Hi,

    I am really sorry, i had no idea you are only using WCfM Free version.

    WCfM Ultimate already few such reateiction options for products.

    We have added new ones for Articles.

    Tell me, now how can I help you in this!

    Thank You

    Thread Starter wpbetsy

    (@wpbetsy)

    I want to set the post categories that the vendor can submit article to.

    Plugin Author WC Lovers

    (@wclovers)

    Hi,

    Add this code to your site’s child theme’s functions.php –

    function wcfm_custom_capability_settings( $wcfm_capability_options ) {
    	global $WCFM;
    	$allowed_article_category    = ( !empty( $wcfm_capability_options['allowed_article_category'] ) ) ? $wcfm_capability_options['allowed_article_category'] : array();
    	
    	$article_categories   = get_terms( 'category', 'orderby=name&hide_empty=0&parent=0' );
    	?>
    	<div class="wcfm_clearfix"></div>
    	<div class="vendor_capability_sub_heading"><h3><?php _e( 'Sections', 'wc-frontend-manager-ultimate' ); ?></h3></div>
    	
    	<p class="wcfm_title catlimit_title"><strong><?php _e( 'Article Categories', 'wc-frontend-manager-ultimate' ); ?></strong></p><label class="screen-reader-text" for="vendor_product_cats"><?php _e( 'Allowed Article Cats', 'wc-frontend-manager-ultimate' ); ?></label>
    	<select id="vendor_allowed_article_category" name="wcfm_capability_options[allowed_article_category][]" class="wcfm-select wcfm_ele" multiple="multiple" data-catlimit="-1" style="width: 44%; margin-bottom: 10px;">
    		<?php
    			if ( $article_categories ) {
    				$WCFM->library->generateTaxonomyHTML( 'category', $article_categories, $allowed_article_category, '', false, false, false );
    			}
    		?>
    	</select>
    	
    	<?php
    }
    
    function wcfmcap_allowed_article_categories( $allow, $taxonomy, $term_id ) {
    	global $WCFM;
    	$wcfm_capability_options = apply_filters( 'wcfm_capability_options_rules', get_option( 'wcfm_capability_options', array() ) );
    	if( $taxonomy == 'category' ) $taxonomy = 'article_category';
    	$allowed_taxonomies    = ( !empty( $wcfm_capability_options['allowed_' . $taxonomy] ) ) ? $wcfm_capability_options['allowed_' . $taxonomy] : array();
    	if( is_array( $allowed_taxonomies ) && !empty( $allowed_taxonomies ) ) {
    		if( !in_array( $term_id, $allowed_taxonomies ) ) {
    			$allow = false;
    		}
    	}
    	return $allow;
    }
    add_filter( 'wcfm_allowed_taxonomies', 'wcfmcap_allowed_article_categories', 600, 3 );

    Thank You

    Thread Starter wpbetsy

    (@wpbetsy)

    Can you please just update and make it available in the plugin? Sometimes the codes conflicts with our files.

    Plugin Author WC Lovers

    (@wclovers)

    Hi,

    It’s difficult for us to add this code in WCfM FREE core plugin as it’s already part of WCFM Ultimate.

    Well, you may add this code and it’s only related to WCfM so no conflict will be there, just relax.

    Thank You

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘vendor article submit category’ is closed to new replies.