• Resolved marzmuso

    (@marzmuso)


    Hi,

    I tried your code in my child theme_.php.

    It creates the Custom Tab fine but when I add shortcode to the template: store/wcfmmp-view-store-art-works.php nothing shows.
    Can you help me with correct path to template. I’ve tried standard woocommerce shortcodes aswell but no luck…

    I’m using rehub 9 ?

    Or Do I need to buy Ultimate to make this work ?

    Thanks
    ________________________________________________________________________

    <<<Your Custom Code>>>

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

Viewing 16 replies (of 16 total)
  • Thread Starter marzmuso

    (@marzmuso)

    I found the problem in Rehub.

    The path you provided should work in child theme but because “wcfmmp-view-store-art-works.php” does not not exist in “wcfm store” folder it shows the error : Warning: include(/home/rifftrad/public_html/wp-content/plugins/wc-multivendor-marketplace/views/store/wcfmmp-view-store-art-works.php): failed to open stream: No such file or directory in /home/rifftrad/public_html/wp-content/plugins/wc-multivendor-marketplace/core/class-wcfmmp-template.php on line 38 in Rehub

    So I had to put this file “wcfmmp-view-store-art-works.php” in the main Rehub theme “WCFM” “STORE” folder which is very strange ? This now works but is ofcourse not the correct way !?

    Any help here would be great.

    Thanks

Viewing 16 replies (of 16 total)
  • The topic ‘Custom Tab On Vendor Store page Not Showing?’ is closed to new replies.