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, 11 months ago by
WCFM Forum.
- AuthorPosts
- March 10, 2018 at 4:21 pm #20079
info31
ParticipantHi,
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 #20086
Bingal
KeymasterHi,
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 #20087
info31
Participant - March 10, 2018 at 6:51 pm #20089
Bingal
KeymasterWell, 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 #20131
info31
ParticipantHi
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 #20170
Bingal
KeymasterHi,
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 #20177
info31
ParticipantHi 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 #20186
Bingal
KeymasterHi,
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 #20199
Kevin
GuestYes. 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 #20231
Kevin
GuestIs Manufacturer considered a Custom Taxonomy? Is that the reason why the code isn’t working?
- March 13, 2018 at 9:36 am #20252
Bingal
KeymasterNo, i send you according code for that.
is that still not working? - March 13, 2018 at 4:22 pm #20300
Kevin
GuestHi,
Manufacturer is not hiding. Only Short Description & Draft Button.
- March 15, 2018 at 8:15 am #20354
WCFM Forum
MemberIt’s resolved. Code added wrongly.
Thank You
- AuthorPosts
- The topic ‘WCFM "Add Product" form editing’ is closed to new replies.