WCFM "Add Product" form editing

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!

Viewing 12 reply threads
  • Author
    Posts
    • #20079
      info31
      Participant

      Hi,
      How can I edit the “Add Product” form?

      I’ve edited most of it through Capabilities, but I would like to remove:

      Manufacturer
      Short Description
      Draft Button

    • #20086
      Bingal
      Member

      Hi,

      It’s very easy to achieve. Here is your help codes for the purpose –

      Hide Short description –

      function wcfm_custom_product_manage_fields_content( $content_fields, $product_id, $product_type ) {
      	$content_fields['excerpt']['label_class'] = 'wcfm_custom_hide';
      	$content_fields['excerpt']['class'] = 'wcfm_custom_hide';
      	return $content_fields;
      }
      add_filter( 'wcfm_product_manage_fields_content', 'wcfm_custom_product_manage_fields_content', 50, 3 );

      Hide Draft button –

      add_filter( 'wcfm_is_allow_draft_published_products', '__return_false' );

      What is “Manufacturer” ?

      Thank You

    • #20087
      info31
      Participant

      Thank you.

      I see a Manufacturer listing on my form.
      https://cl.ly/q5LB

      Can I remove that too?

    • #20089
      Bingal
      Member

      Well, it’s a custom taxonomy. Kindly add this code to disable this –

      add_filter( 'wcfm_is_allow_custom_taxonomy', '__return_false' );

      Thank You

    • #20131
      info31
      Participant

      Hi

      I’ve added the above code into my childtheme’s function.php, but it doesn’t seem to work. Those fields still remain there:

      function wcfm_custom_product_manage_fields_content( $content_fields, $product_id, $product_type ) {
      $content_fields['excerpt']['label_class'] = 'wcfm_custom_hide';
      $content_fields['excerpt']['class'] = 'wcfm_custom_hide';
      return $content_fields;
      }
      add_filter( 'wcfm_product_manage_fields_content', 'wcfm_custom_product_manage_fields_content', 50, 3 );

      add_filter( 'wcfm_is_allow_draft_published_products', '__return_false' );

      add_filter( ‘wcfm_is_allow_custom_taxonomy’, ‘__return_false’ );

    • #20170
      Bingal
      Member

      Hi,

      Now this is really impossible.

      Which theme you are using?

      Well, in alternate add codes using this plugin – https://wordpress.org/plugins/code-snippets/

      Thank You

    • #20177
      info31
      Participant

      Hi Bingal,

      It works when I put it in Code Snippets. Short Description / Draft are hidden, but Manufacturer still shows. Is that code that I sent above correct?

      Weirdly, this happened to another code (Add new links to WCFM menu) that WC Lovers provided previously. It didn’t work on (Childs theme) functions.php but worked in Code Snippets. Would you have a clue on why this happens? Ideally i would like all code to be in functions.php, to reduce on the number of plugins slowing down my site.

    • #20186
      Bingal
      Member

      Hi,

      add_filter( ‘wcfm_is_allow_custom_taxonomy’, ‘__return_false’ ); – its quotes are wrong, use normal single quote (‘)

      Hope, you have a child theme for the purpose. I think your child theme not properly configured. Is any code from child theme’s functions.php working on your site?

      You are using “My Listings” theme, such theme’s comes with some strict guidelines of use child theme.

      Thank You

    • #20199
      Kevin
      Guest

      Yes. All other code in the childtheme’s function.php works. Somehow only the code from WCFM doesn’t seem to work. I’m very confused as well.

      Is this code correct now? I copied from the one you initially sent:
      add_filter( ‘wcfm_is_allow_custom_taxonomy’, ‘__return_false’ );

      I don’t understand this (its quotes are wrong, use normal single quote (‘)

    • #20231
      Kevin
      Guest

      Is Manufacturer considered a Custom Taxonomy? Is that the reason why the code isn’t working?

    • #20252
      Bingal
      Member

      No, i send you according code for that.
      is that still not working?

    • #20300
      Kevin
      Guest

      Hi,

      Manufacturer is not hiding. Only Short Description & Draft Button.

    • #20354
      WCFM Forum
      Member

      It’s resolved. Code added wrongly.

      Thank You

Viewing 12 reply threads
  • The topic ‘WCFM "Add Product" form editing’ is closed to new replies.