Displaying custom post as default tab on vendor store page?

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 8 reply threads
  • Author
    Posts
    • #57194
      me
      Participant

      Hi,

      Thanks for this awesome plugin!
      I’m trying to extend the vendor store page by changing the default tab to showing a custom post.
      Since I couldn’t figure out how to change the default tab, I modified the product tab usi

      It kinda works, but the css styles don’t work properly on the modified store page. Formatting works perfectly on the post’s original page.
      This might have something to do with Visual Composer which I use to create these pages. But the appropriate css files seem to be loaded in both cases.

      My questions:
      1. Is there a way to add or remove tabs from the vendor store page?
      2. Is there a way to change the default tab from product to something else?
      3. What should I do to make the stlyesheets work properly when I display a post on a store page tab?

      Thanks a lot!
      I love your plugins, by the way! Keep up the good work! 🙂

    • #57195
      me
      Participant
      This reply has been marked as private.
    • #57477
      WCFM Forum
      Member

      HI,

      Well, it’s possible to add custom tab at store page for custom post types.

      But it’s not possible to set that default tab.

      Thank You

    • #57536
      me
      Participant

      Ok, great, can you help me with how to do that?

    • #57559
      WCFM Forum
      Member

      Hi,

      Yes we can, but that will be a paid customization.

      If you are interested then please contact us here – https://wclovers.com/woocommerce-multivendor-customization/

      Thank You

    • #57563
      me
      Participant

      I’m just asking how to add or remove tabs from the store page.
      I completely understand if the rest is in the paid category.
      But isn’t adding a tab similar to adding a menu item, with which you helped a many people here?
      By the way, I’m definitely planning to contact you for paid customization regarding your new app, once I’ve closed our fundraising round.

    • #57685
      WCFM Forum
      Member

      Hi,

      Here is your code for the purpose –

      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);

      Add this code to your child theme’s functions.php and create a template with name “wcfmmp-view-store-art-works.php” at child theme/wcfm/store

      Now, add your content for that new tab under this template.

      You will have anew tab name “Art Work” at store pages – https://ibb.co/nQP8bx6

      Thank You

    • #57696
      me
      Participant

      Thank you so much!

    • #57812
      WCFM Forum
      Member

      You are welcome 🙂

Viewing 8 reply threads
  • The topic ‘Displaying custom post as default tab on vendor store page?’ is closed to new replies.