Required fields in WCFM

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 18 reply threads
  • Author
    Posts
    • #17612
      Brad Z
      Guest

      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

    • #17616
      WCFM Forum
      Keymaster

      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

    • #17756
      sharkmediasport
      Participant

      Hi,

      I’m also interested in having paypal email adress mandatory.

      Can you provide to code to do it ?

      Thank you
      JF

    • #17757
      Simha
      Guest

      Hi,

      Yah sure, I will.

      Please know me just which multi-vendor plugin you are using in!

      Thank You

    • #17762
      sharkmediasport
      Participant

      Hi,

      I’m using woocommerce product vendors.

      Thank you
      JF

    • #17771
      WCFM Forum
      Keymaster

      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

    • #17790
      sharkmediasport
      Participant

      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

    • #17791
      Brad
      Guest
      This reply has been marked as private.
    • #17792
      Brad
      Guest

      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?

    • #17793
      WCFM Forum
      Keymaster

      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

    • #17857
      WCFM Forum
      Keymaster

      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

    • #17868
      sharkmediasport
      Participant

      That’s very king of you, thanks for your time, I should be able to have something working from your link.

      JF

    • #17886
      WCFM Forum
      Keymaster

      Welcome 🙂

      Please know me if I can help you some other way.

      Simha

    • #17928
      bradziajor
      Participant

      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.
    • #17935
      WCFM Forum
      Keymaster

      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

    • #17951
      bradziajor
      Participant

      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.

    • #17954
      WCFM Forum
      Keymaster

      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

    • #17958
      bradziajor
      Participant

      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.”

    • #17962
      WCFM Forum
      Keymaster

      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

Viewing 18 reply threads
  • The topic ‘Required fields in WCFM’ is closed to new replies.