create tab in store page and store settings
-
hi good day
i am trying to install a new tab in the vendor store settings tab under store tab
this tab is going to have an acf fields group that the vendor is going to fill so it must show in the store page
i follow all the steps:
https://docs.wclovers.com/tweaks/#new-tab-at-store-page
https://wclovers.com/forums/topic/new-tab-at-store-page/and also this
<?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 ), ) ); ?> <?php $business_type_checked_values = get_field( 'business_type', 'option' ); ?> <?php if ( $business_type_checked_values ) : ?> <?php foreach ( $business_type_checked_values as $business_type_value ): ?> <?php echo esc_html( $business_type_value ); ?> <?php endforeach; ?> <?php endif; ?> </div> </div> <!-- end collapsible --> <?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 ); add_action( 'wcfmmp_store_list_after_store_info', function( $vendor_id, $store_info ) { global $WCFM; $site_url = get_user_meta( $vendor_id, 'wcfm_vendor_website', true ); if( $site_url ) { $site_url_href = $site_url; if (strpos( $site_url_href, 'http') === false) { $site_url_href = "https://" . $site_url_href; } ?> <p class="store-phone"> <i class="wcfmfa fa-globe" aria-hidden="true"></i> <a href="<?php echo $site_url_href; ?>"><?php echo $site_url; ?></a> </p> <?php } }, 10, 2 ); add_action( 'after_wcfmmp_store_header_info', function( $vendor_id ) { global $WCFM; $site_url = get_user_meta( $vendor_id, 'wcfm_vendor_website', true ); if( $site_url ) { $site_url_href = $site_url; if (strpos( $site_url_href, 'http') === false) { $site_url_href = "https://" . $site_url_href; } ?> <div class="store_info_parallal"> <i class="wcfmfa fa-globe" aria-hidden="true"></i> <span> <a href="<?php echo $site_url_href; ?>"><?php echo $site_url; ?></a> </span> </div> <div class="spacer"></div> <?php } }, 10 ); add_filter( 'wcfm_marketplace_settings_fields_general', function( $setting_fields, $vendor_id ) { if( !wcfm_is_vendor() ) { $wcfm_vendor_website = get_user_meta( $vendor_id, 'wcfm_vendor_website', true ); $wcfm_vendor_website_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 ), ); $setting_fields = array_merge( $wcfm_vendor_website_field, $setting_fields ); } return $setting_fields; }, 50, 2 ); ?>
but i cannot make it to work i use ELECTRO THEME
let me put some image for more contexthttps://ibb.co/J352F9q
https://ibb.co/x5CPp8yal the template i modify was
\demo\wp-content\themes\electro-child\wcfm\store
wcfmmp-view-store-art-works.php
wcfmmp-view-store.phpand
demo\wp-content\plugins\wc-multivendor-marketplace\core
class-wcfmmp-store.phphttps://ibb.co/5sWqDZC
https://ibb.co/fH6ZMvb
https://ibb.co/Y8ywMRW
https://ibb.co/1LrVdcg
https://ibb.co/swN4SFb
https://ibb.co/p1zFGrV
- The topic ‘create tab in store page and store settings’ is closed to new replies.