Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Ultimate › WCFM "Add Product" form editing
- This topic has 12 replies, 4 voices, and was last updated 6 years, 8 months ago by WCFM Forum.
- AuthorPosts
- March 10, 2018 at 4:21 pm #20079info31Participant
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 - March 10, 2018 at 4:37 pm #20086BingalMember
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
- March 10, 2018 at 5:02 pm #20087info31Participant
- March 10, 2018 at 6:51 pm #20089BingalMember
Well, it’s a custom taxonomy. Kindly add this code to disable this –
add_filter( 'wcfm_is_allow_custom_taxonomy', '__return_false' );
Thank You
- March 11, 2018 at 4:53 am #20131info31Participant
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’ );
- March 11, 2018 at 10:08 pm #20170BingalMember
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
- March 12, 2018 at 1:54 am #20177info31Participant
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.
- March 12, 2018 at 4:18 am #20186BingalMember
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
- March 12, 2018 at 8:53 am #20199KevinGuest
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 (‘)
- March 12, 2018 at 5:07 pm #20231KevinGuest
Is Manufacturer considered a Custom Taxonomy? Is that the reason why the code isn’t working?
- March 13, 2018 at 9:36 am #20252BingalMember
No, i send you according code for that.
is that still not working? - March 13, 2018 at 4:22 pm #20300KevinGuest
Hi,
Manufacturer is not hiding. Only Short Description & Draft Button.
- March 15, 2018 at 8:15 am #20354WCFM ForumMember
It’s resolved. Code added wrongly.
Thank You
- AuthorPosts
- The topic ‘WCFM "Add Product" form editing’ is closed to new replies.