Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Ultimate › Required fields in WCFM
- This topic has 18 replies, 4 voices, and was last updated 6 years, 10 months ago by WCFM Forum.
- AuthorPosts
- January 6, 2018 at 11:53 pm #17612Brad ZGuest
Hello, I need to make the following fields required for vendors:
Paypal email
Custom Product Attribute – “Years of Experience”
Please let me know if possible.
Thank you,
Brad - January 7, 2018 at 7:43 am #17616WCFM ForumMember
HI Brad,
Thanks for get in touch with us.
It’s absolutely possible to achieve.
Can you please show me screenshot of those fields so that I can help you accordingly!
Thank You
Simha - January 11, 2018 at 1:35 pm #17756sharkmediasportParticipant
Hi,
I’m also interested in having paypal email adress mandatory.
Can you provide to code to do it ?
Thank you
JF - January 11, 2018 at 1:40 pm #17757SimhaGuest
Hi,
Yah sure, I will.
Please know me just which multi-vendor plugin you are using in!
Thank You
- January 11, 2018 at 1:45 pm #17762sharkmediasportParticipant
Hi,
I’m using woocommerce product vendors.
Thank you
JF - January 11, 2018 at 3:43 pm #17771WCFM ForumMember
Hi,
Here is your custom code for the purpose –
function wcfm_wcpvendors_custom_settings_fields_billing( $billing_fields ) { if( isset( $billing_fields['paypal'] ) ) { $billing_fields['paypal']['custom_attributes'] = array( 'required' => 1 ); } return $billing_fields; } add_filter( 'wcfm_wcpvendors_settings_fields_billing', 'wcfm_wcpvendors_custom_settings_fields_billing', 50 );
Just add this code in your site child theme’s functions.php
Please know me is this works for you or not!
Thank You
- January 11, 2018 at 11:21 pm #17790sharkmediasportParticipant
Hi,
yes thank you very much, it is now required. Ultimately I would love to have it required on the vendor registration form but I don’t think I’m at right place to ask.
Otherwise, your solution is good. Thanks !!
JF
- January 12, 2018 at 12:20 am #17791BradGuestThis reply has been marked as private.
- January 12, 2018 at 12:44 am #17792BradGuest
Hi sorry, the custom code posted above did not work for me. I also cannot seem to paste a print screen into this chat so can I send it somewhere?
- January 12, 2018 at 5:34 am #17793WCFM ForumMember
Hi,
This code is for Vendor’s Settings page Billing -> PayPal Email, and not for Registration form.
Hope you are using WC Product Vendors default registration page?
Let me try to find a solution for you.You have register and logged in to send attachment here. Or you may also directly send them in mail – wclovers.contact@gmail.com
Thank You
- January 14, 2018 at 7:10 pm #17857WCFM ForumMember
Hi,
I just found this article – https://nicola.blog/2016/04/19/adding-custom-fields-vendor-registration-form/
Hope this will helpful for you.
Thank You
- January 15, 2018 at 12:49 am #17868sharkmediasportParticipant
That’s very king of you, thanks for your time, I should be able to have something working from your link.
JF
- January 15, 2018 at 6:00 am #17886WCFM ForumMember
Welcome 🙂
Please know me if I can help you some other way.
Simha
- January 15, 2018 at 4:35 pm #17928bradziajorParticipant
I do use WC Product Vendors and my request was for the Paypal field to be required on the WCFM screen, not registration. My other request was for a custom attribute to be made required. Screenshots attached for the custom attribute.
Attachments:
You must be logged in to view attached files. - January 15, 2018 at 5:16 pm #17935WCFM ForumMember
Hi,
I have already give you code for restrict PayPal field as required –
function wcfm_wcpvendors_custom_settings_fields_billing( $billing_fields ) { if( isset( $billing_fields['paypal'] ) ) { $billing_fields['paypal']['custom_attributes'] = array( 'required' => 1 ); } return $billing_fields; } add_filter( 'wcfm_wcpvendors_settings_fields_billing', 'wcfm_wcpvendors_custom_settings_fields_billing', 50 );
It’s difficult set custom attribute as required as we have no clue how many custom attributes are there and which should be required!
Can you please know us purpose of this “Years of experience”, actually I am just trying to understand if this possible to achieve some other way!?
Thank You
- January 15, 2018 at 5:40 pm #17951bradziajorParticipant
Unfortunately, the code does not work as I stated before. I do have another field set as required, will that make a difference? Here is the custom code I already have:
function wcfm_custom_product_manage_fields_advanced( $wcmp_advanced_fields ) {
if( isset( $wcmp_advanced_fields[‘enable_reviews’] ) ) {
$wcmp_advanced_fields[‘enable_reviews’][‘custom_attributes’] = array( ‘required’ => 1 );
}
return $wcmp_advanced_fields;
}
add_filter( ‘wcfm_product_manage_fields_advanced’, ‘wcfm_custom_product_manage_fields_advanced’, 50, 2 );Also, I only have one custom attribute and that will be the only one required. It is to tell customers how many years of experience the service provider has with the product they are selling.
- January 15, 2018 at 6:00 pm #17954WCFM ForumMember
Hi,
That’s really strange, why this code is not working for you.
Just to mention, there is no connection between two codes.
I just want to confirm one thing, you are using this plugin, right? https://woocommerce.com/products/product-vendors/
Thank You
- January 15, 2018 at 6:07 pm #17958bradziajorParticipant
Yes, correct. I added this new code below the other code in Listify Child: Theme Functions (functions.php). I received an error that says “Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.”
- January 15, 2018 at 6:38 pm #17962WCFM ForumMember
Hi,
There is no issue in this code, you may add this to your site. WP normally restrict PHP code update from WP editor.
For demo I have just added this in our Product vendor demo site, kindly take a look. – http://wcpvendors.wcfmdemos.com/wcfm/
function wcfm_wcpvendors_custom_settings_fields_billing( $billing_fields ) {
if( isset( $billing_fields[‘paypal’] ) ) {
$billing_fields[‘paypal’][‘custom_attributes’] = array( ‘required’ => 1 );
}
return $billing_fields;
}
add_filter( ‘wcfm_wcpvendors_settings_fields_billing’, ‘wcfm_wcpvendors_custom_settings_fields_billing’, 50 );Our team is looking for solution for “custom attributes”.
Thank You
- AuthorPosts
- The topic ‘Required fields in WCFM’ is closed to new replies.