• Resolved tiwit

    (@tiwit)


    Hi,
    I am trying your free plugin and so far I find it really impressive.

    I am just trying to display some ‘shortcode’ from a wordpress plugins in the vendor store front page. It is poossible in your free plugin to add an extra TAB anywhere between PRODUCTS and REVIEWS, with the possibility of adding addition text and shortcode from wordpress plugins. I even tried adding shortcode in the ABOUT page but obviously that did not work. I just need a page to display a “shortcode” in the vendor page.

    Any help is highly appreciated.

    regards!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author WC Lovers

    (@wclovers)

    Hi,

    Thanks for get in touch with us.

    Well, it off course possible, but custom coding required.

    Here is that code -> this will add “Art Works” new tab under store page –

    add_action( 'wcfmmp_rewrite_rules_loaded', function( $wcfm_store_url ) {
    	add_rewrite_rule( $wcfm_store_url.'/([^/]+)/art_works?$', 'index.php?'.$wcfm_store_url.'=$matches[1]&art_works=true', 'top' );
    	add_rewrite_rule( $wcfm_store_url.'/([^/]+)/art_works/page/?([0-9]{1,})/?$', 'index.php?'.$wcfm_store_url.'=$matches[1]&paged=$matches[2]&art_works=true', 'top' );
    }, 50 );
    
    add_filter( 'query_vars', function( $vars ) {
    	$vars[] = 'art_works';
    	return $vars;
    }, 50 );
    
    add_filter( 'wcfmmp_store_tabs', function( $store_tabs, $store_id ) {
      $store_tabs['art_works'] = 'Art Works';
      return $store_tabs;
    }, 50, 2 );
    
    add_filter( 'wcfmp_store_tabs_url', function( $store_tab_url, $tab ) {
    	if( $tab == 'art_works' ) {
    		$store_tab_url .= 'art_works';
    	}
    	return $store_tab_url;
    }, 50, 2 );
    
    add_filter( 'wcfmp_store_default_query_vars', function( $query_var ) {
    	global $WCFM, $WCFMmp;
    	
    	if ( get_query_var( 'art_works' ) ) {
    		$query_var = 'art_works';
    	}
    	return $query_var;
    }, 50 );
    
    add_filter( 'wcfmp_store_default_template', function( $template, $tab ) {
      if( $tab == 'art_works' ) {
      	$template = 'store/wcfmmp-view-store-art-works.php';
      }
      return $template;
    }, 50, 2);

    You have to create a template at your “child theme/wcfm/store/wcfmmp-view-store-art-works.php”

    Now, add any content at that template and that will visible under that new tab.

    Hope this will helpful for you ??

    Thank You

    Thread Starter tiwit

    (@tiwit)

    Thank you so much for your prompt reply. I will try that.

    Plugin Author WC Lovers

    (@wclovers)

    You are welcome ??

    Hi, how can i translate this tabs in Vendor Store to my language?
    Portuguese from Brazil?

    Hi,

    Does this code still work to create custom tab in vendor store page ?

    Must I create template php file or can in be placed directly in child theme php file ?

    2. Where do I place [shortcode] for this tab after this code is activated ?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Additional Tab for shortcode at Vendor Store’ is closed to new replies.