Adding new fields on

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 7 reply threads
  • Author
    Posts
    • #44778
      FuBendu
      Participant

      Hi

      What is the neatest way to have new vendor meta fields (VAT, etc..) appear as custom fields in the vendor Store Settings – Store tab (or even a new tab).

      I am using FREE WC Vendors & WCFM Ultimate.

      Thank you

    • #44815
      WCFM Forum
      Member

      HI,

      I have created “Website” for registration – https://ibb.co/qBgz9zP

      Now, vendors are allow to edit that from WCFM Dashboard -> Profile -> Additional Info -> https://ibb.co/rxwDLvK

      Added short code under sidebar widgets – https://ibb.co/fxBcPSn

      And visible – https://ibb.co/m8643Wg

      Now, problem is this possible using WCFM own multi-vendor module (https://wordpress.org/plugins/wc-multivendor-marketplace/)
      Now for WC Vendors will require custom coding.

      Thank You

    • #44933
      FuBendu
      Participant

      Thank you for this but I am using WC Vendors and it seems that I cannot access the options you highlight in above menu. Am I missing something? thanks

    • #44944
      FuBendu
      Participant

      Just to clarify, I already have values stored in user meta fields but I wish these to be seamlessly displayed and made editable on the vendor user settings interface, preferably without touching the WCFM code.

      As to how they get used and displayed – that is sorted from my end.

      Thanks again

    • #44985
      WCFM Forum
      Member

      OK, I will give you code snippet for this.

      Thank You

    • #45083
      WCFM Forum
      Member

      Hi,

      Here is your code -> Add this to your child theme’s functions.php –

      add_action( 'end_wcfm_vendor_settings', function( $vendor_id ) {
      	global $WCFM;
      	$wcfm_vendor_website = get_user_meta( $vendor_id, 'wcfm_vendor_website', true );	
      	
      	?>                                
      	<!-- collapsible -->
      	<div class="page_collapsible" id="wcfm_settings_form_additional_head">
      		<label class="fa fa-certificate"></label>
      		<?php _e('Additional Info', 'wc-multivendor-marketplace'); ?><span></span>
      	</div>
      	<div class="wcfm-container">
      		<div id="wcfm_settings_form_additional_expander" class="wcfm-content">
      			<h2><?php _e('Additional Setting', 'wc-multivendor-marketplace'); ?></h2>
      			<div class="wcfm_clearfix"></div>
      			
      			<?php
      				$WCFM->wcfm_fields->wcfm_generate_form_field( array(
      																														"wcfm_vendor_website" => array( 'label' => __( 'Website', 'wc-multivendor-marketplace'), 'name' => 'wcfm_vendor_website', 'type' => 'text', 'class' => 'wcfm-text wcfm_ele', 'label_class' => 'wcfm_title wcfm_ele', 'value' => $wcfm_vendor_website ),
      																													 ) );
      			?>
      		</div>
      	</div>
      	<?php
      }, 50, 1 );
      
      add_action( 'wcfm_vendor_settings_update', function( $vendor_id, $wcfm_settings_form ) {
      	global $WCFM, $_POST;
      	if( isset( $wcfm_settings_form['wcfm_vendor_website'] ) ) {
      		update_user_meta( $vendor_id, 'wcfm_vendor_website', $wcfm_settings_form['wcfm_vendor_website'] );
      	}
      }, 50, 2 );

      This will create a custom field like this – https://ibb.co/YNqbqQF

      Thank You

    • #45149
      FuBendu
      Participant

      Thank you – worked brilliantly

    • #45248
      WCFM Forum
      Member

      Great … you are welcome 🙂

Viewing 7 reply threads
  • The topic ‘Adding new fields on’ is closed to new replies.