WCFM ACF custom fields vendor setings
-
Hello
i’am using ADVANCED CUSTOM FIELDS to created a group of text fields in ACF to display on the vendors store setting tab and display in store page in a tab i already make that the tab a new tab in store page appears and work and i have a tab un store settings also but i dont undestand how to put a group of text field of acf in my snippet i will post some image for help:this code is for the tab in store settings also i want to give her priority under store and location position but i couldn’t find a such thing to work.
add_action( 'end_wcfm_vendor_settings', function( $vendor_id ) { global $WCFM, $WCFMmp; $wcfm_vendor_company = get_user_meta( $vendor_id, 'wcfm_vendor_company', true ); ?> <!-- collapsible --> <div class="page_collapsible" id="wcfm_settings_form_min_order_amount_head"> <label class="wcfmfa fa-building"></label> <?php _e('Company', 'wc-frontend-manager'); ?><span></span> </div> <div class="wcfm-container"> <div id="wcfm_settings_form_vendor_invoice_expander" class="wcfm-content"> <?php $WCFM->wcfm_fields->wcfm_generate_form_field( array( "wcfm_vendor_company_options" => array('label' => __('Company', 'wc-frontend-manager'), 'type' => 'textarea', 'class' => 'wcfm-textarea wcfm_ele wcfm_full_ele', 'label_class' => 'wcfm_title wcfm_ele wcfm_full_ele_title', 'value' => $wcfm_vendor_company ), ) ); ?> </div> </div> <div class="wcfm_clearfix"></div> <!-- end collapsible --> <?php }, 500 ); add_action( 'wcfm_vendor_settings_update', function( $vendor_id, $wcfm_settings_form ) { global $WCFM, $WCFMmp; if( isset( $wcfm_settings_form['wcfm_vendor_company_options'] ) ) { $wcfm_vendor_company = $wcfm_settings_form['wcfm_vendor_company_options']; update_user_meta( $vendor_id, 'wcfm_vendor_company', $wcfm_vendor_company ); } }, 500, 2 );
this is the code i use for tab in store page
add_filter( 'wcfmmp_store_tabs', 'custom_wcfmmp_store_tabs',90,2); function custom_wcfmmp_store_tabs($store_tabs, $vendor_id) { $store_tabs['company'] = __( 'Company', 'wc-multivendor-marketplace' ); return $store_tabs; } add_filter( 'wcfmp_store_default_query_vars', 'wcfm_store_events_default_query_var' ); function wcfm_store_events_default_query_var( $query_var ) { global $WCFM, $WCFMmp; if ( get_query_var( 'company' ) ) { $query_var = 'company'; } return $query_var; } add_filter( 'wcfmp_store_tabs_url', 'new_wcfmp_store_tabs_url',10,2); function new_wcfmp_store_tabs_url($store_tab_url, $tab) { switch( $tab ) { case 'company': $store_tab_url = $store_tab_url.'company'; break; } return $store_tab_url; } add_action( 'wcfmmp_rewrite_rules_loaded', 'new_register_rule', 8 ); function new_register_rule($wcfm_store_url) { global $WCFM, $WCFMmp; add_rewrite_rule( $wcfm_store_url.'/([^/]+)/'.$WCFMmp->wcfmmp_rewrite->store_endpoint('company').'?$', 'index.php?post_type=product&'.$wcfm_store_url.'=$matches[1]&'.$WCFMmp->wcfmmp_rewrite->store_endpoint('company').'=true', 'top' ); add_rewrite_rule( $wcfm_store_url.'/([^/]+)/'.$WCFMmp->wcfmmp_rewrite->store_endpoint('company').'/page/?([0-9]{1,})/?$', 'index.php?post_type=product&'.$wcfm_store_url.'=$matches[1]&paged=$matches[2]&'.$WCFMmp->wcfmmp_rewrite->store_endpoint('company').'=true', 'top' ); } function wcfm_vendor_profile_custom_endpoint() { global $WCFM, $WCFMmp,$WCFMu; $wcfm_store_url = get_option( 'wcfm_store_url', 'store' ); add_rewrite_endpoint( 'company', EP_ROOT | EP_PAGES ); } add_action( 'init', 'wcfm_vendor_profile_custom_endpoint',12 );
i’ve tried a lot of rules for post types, users, forms.but it dosent shown on the vendors store settings page
is there any thing to do to fixthis
- The topic ‘WCFM ACF custom fields vendor setings’ is closed to new replies.