Creating new Vendor Page Link Tabs

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 1 reply thread
  • Author
    Posts
    • #101860
      puppycircles
      Participant

      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

    • #102439

      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.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.