Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › Creating new Vendor Page Link Tabs
- This topic has 1 reply, 2 voices, and was last updated 4 years, 9 months ago by Sarmistha Chakraborty.
- AuthorPosts
- January 13, 2020 at 9:49 am #101860puppycirclesParticipant
Hi There,
Is there a way to create new link tabs to the Vendor Store pages, similar to the “About” tab? I would like vendors to be able to add more content (photos, rich text, etc) using these tabs.
Thanks
- January 17, 2020 at 1:53 pm #102439Sarmistha ChakrabortyMember
Hello,
Add custom tab to vendor store page,
add_filter( 'wcfmmp_store_tabs', 'custom_wcfmmp_store_tabs',90,2); function custom_wcfmmp_store_tabs($store_tabs, $vendor_id) { $store_tabs['newtab'] = __( 'NEW Tab', '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( 'newtab' ) ) { $query_var = 'newtab'; } 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 'newtab': $store_tab_url = $store_tab_url.'newtab'; 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('newtab').'?$', 'index.php?post_type=product&'.$wcfm_store_url.'=$matches[1]&'.$WCFMmp->wcfmmp_rewrite->store_endpoint('newtab').'=true', 'top' ); add_rewrite_rule( $wcfm_store_url.'/([^/]+)/'.$WCFMmp->wcfmmp_rewrite->store_endpoint('newtab').'/page/?([0-9]{1,})/?$', 'index.php?post_type=product&'.$wcfm_store_url.'=$matches[1]&paged=$matches[2]&'.$WCFMmp->wcfmmp_rewrite->store_endpoint('newtab').'=true', 'top' ); } function wcfm_vendor_profile_custom_endpoint() { global $WCFM, $WCFMmp,$WCFMu; $wcfm_store_url = get_option( 'wcfm_store_url', 'store' ); add_rewrite_endpoint( 'newtab', EP_ROOT | EP_PAGES ); } add_action( 'init', 'wcfm_vendor_profile_custom_endpoint',12 );
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/Create “wcfmmp-view-store-newtab.php” file in your active theme’s
<your active theme>/wcfm/store/wcfmmp-view-store-newtab.php
. In this file add your custom content.
If you are facing any problem, you may reach us here for this – https://wclovers.com/woocommerce-multivendor-customization/Thanks.
- AuthorPosts
- You must be logged in to reply to this topic.