How to make the country and state mandatory field to be filled.

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!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Marketplace (WooCommerce Multivendor Marketplace) How to make the country and state mandatory field to be filled.

Viewing 2 reply threads
  • Author
    Posts
    • #78512
      georgeanna
      Participant

      I want to make the field of state and country obligatory to be fulfilled.
      As it looks in code it has the mandatory attribute:

      “state” => array(‘label’ => __(‘Store State/County’, ‘wc-multivendor-marketplace’), ‘name’ => ‘vendor_data[address][state]’, ‘type’ => ‘select’, ‘in_table’ => ‘yes’, ‘class’ => ‘wcfm-select wcfm_ele’, ‘label_class’ => ‘wcfm_title wcfm_ele’, ‘custom_attributes’ => array( ‘required’ => true ), ‘options’ => $state_options, ‘value’ => $state ).
      On class-wcfmmp-store-setuo.php file.
      But if you leave it blank and press “Continue” it goes to the next stage.
      How can i fix it.
      Thank you

    • #79116
      WCFM Forum
      Keymaster

      Hi,

      Well, there has many fields which are required, but we do not apply these rules at “Store Setup” widget.

      But when vendor will be at his dashboard’s setting section then he has to filled up these fields.

      Thank You

    • #138231
      mohsinkhan3687
      Participant

      hi wcfm
      i want to make store setup field mandatory how i will do that

      Attachments:
      You must be logged in to view attached files.
      • #138280

        Hello,

        We have already replied in previously, we do not apply “required”rules at “Store Setup” widget.
        You can make required field in vendor’s settings page (add this in your theme’s functions.php)-

        add_filter('wcfm_marketplace_settings_fields_address',function($fields, $user_id) {
        	$fields['street_1']['custom_attributes'] = array( 'required' => 1 );
        	$fields['state']['custom_attributes'] = array( 'required' => 1 );
        	$fields['country']['custom_attributes'] = array( 'required' => 1 );
        	
        	return $fields;
        },10,2);

        Thanks.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.