Sold Individually flagged by default and not editable by Store Vendor

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 – Marketplace (WooCommerce Multivendor Marketplace) Sold Individually flagged by default and not editable by Store Vendor

Viewing 3 reply threads
  • Author
    Posts
    • #60878
      cartaclaudio
      Participant

      Hi,

      I have made Sold Indidually Check box flagged by default, for every product. However I would also like to remove this option for Store Vendors, as all the products on the website are downloadable and therefore no one can buy more than one. How can this be achieved?

    • #61286
      WCFM Forum
      Member

      HI,

      Please add this code to your child theme’s functions.php –

      add_filter( 'wcfm_product_fields_stock', function( $stock_fields, $product_id, $product_type ) {
      	if( !$product_id ) {
      		if( isset( $stock_fields['sold_individually'] ) ) {
      			$stock_fields['sold_individually']['dfvalue'] = 'enable';
      		}
      	}
      	$stock_fields = wcfm_hide_field( 'sold_individually', $stock_fields );
        return $stock_fields;
      }, 50, 3 );

      Thank You

    • #61476
      Claudio Carta
      Guest

      Thank you

    • #61727
      WCFM Forum
      Member

      You are welcome 🙂

Viewing 3 reply threads
  • The topic ‘Sold Individually flagged by default and not editable by Store Vendor’ is closed to new replies.