Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › Displaying custom post as default tab on vendor store page?
- This topic has 8 replies, 2 voices, and was last updated 5 years, 8 months ago by WCFM Forum.
- AuthorPosts
- April 10, 2019 at 6:52 pm #57194meParticipant
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 usiIt 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! 🙂 - April 10, 2019 at 6:57 pm #57195meParticipantThis reply has been marked as private.
- April 12, 2019 at 6:57 pm #57477WCFM ForumMember
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
- April 12, 2019 at 11:18 pm #57536meParticipant
Ok, great, can you help me with how to do that?
- April 13, 2019 at 9:39 am #57559WCFM ForumMember
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
- April 13, 2019 at 9:44 am #57563meParticipant
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. - April 14, 2019 at 12:12 pm #57685WCFM ForumMember
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
- April 14, 2019 at 1:56 pm #57696meParticipant
Thank you so much!
- April 15, 2019 at 5:49 am #57812WCFM ForumMember
You are welcome 🙂
- AuthorPosts
- The topic ‘Displaying custom post as default tab on vendor store page?’ is closed to new replies.