• 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 15 replies - 1 through 15 (of 16 total)
  • Plugin Author WC Lovers

    (@wclovers)

    Hi,

    store/wcfmmp-view-store-art-works.php
    – Where you have created this template? It should be at your child theme -> wcfm -> store -> wcfmmp-view-store-art-works.php

    Also show me how you have added short code in the template.

    Thank You

    Thread Starter marzmuso

    (@marzmuso)

    Hi,
    To be clear I changed all “art works” to my own custom label “video tutorials”.

    I put your code in my grandchild plugin for rehub and it renders tab correctly on vendor store page next to reviews.

    2. I created 2 folders named wcfm and store in rehub grandchild plugin.php. Then created file wcfmmp-view-store-video-tutorials.php and put it in store folder.

    3. I tried many shortcodes even tried standard [woocommerce shortcodes] and put them inside like this:

    <?php ( ‘[RH_ELEMENTOR id=”7059″] ‘ ); ?>

    Ca you tell me what I’m doing wrong ?

    Thanks

    Thread Starter marzmuso

    (@marzmuso)

    Hi,

    In my c/panel it wont let me create php file with this character “/” store/wcfmmp-view-store-art-works.php ??

    Plugin Author WC Lovers

    (@wclovers)

    Hi,

    2. I created 2 folders named wcfm and store in rehub grandchild plugin.php. Then created file wcfmmp-view-store-video-tutorials.php and put it in store folder.

    – “store” folder should be inside “wcfm” folder.

    3. I tried many shortcodes even tried standard [woocommerce shortcodes] and put them inside like this:

    <?php ( ‘[RH_ELEMENTOR id=”7059″] ‘ ); ?>

    – Your code is wrong. it should be –

    <?php echo do_shortcode( '[RH_ELEMENTOR id="7059"]' ); ?>

    In my c/panel it wont let me create php file with this character “/” store/wcfmmp-view-store-art-works.php ??

    – File name should not contain “/”. We have used this to mention it’s under folder.
    In for child theme create a folder “wcfm”, then create “store” folder inside “wcfm” folder and now create “wcfmmp-view-store-art-works.php” file under “store” folder.

    Like this – https://ibb.co/dP1Cwc3

    Thank You

    Thread Starter marzmuso

    (@marzmuso)

    Hi,
    my mistake. I actually did input this shortcode:

    <?php echo do_shortcode( ‘[RH_ELEMENTOR id=”7059″]’ ); ?>

    I also made both wcfm folder and put store folder inside but nothing appears under tab in vendor page. Its just blank. I’m using Rehub 9 theme.

    any ideas ?

    Plugin Author WC Lovers

    (@wclovers)

    HI,

    Code and template is perfectly fine.

    I have just run this code again and it’s working fine – https://www.loom.com/share/e5f1c21b9eb7414193f22827ae5cac9c

    I think this short code is not working. Did you tried this short code by added directly in a page? Is this showing anything!

    Well, just write some normal text at this template “wcfmmp-view-store-art-works.php” and be sure those are visible at that tab or not!

    Thank You

    Thread Starter marzmuso

    (@marzmuso)

    Hi,

    Ok well I followed all instructions but get this 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

    Warning: include(): Failed opening ‘/home/rifftrad/public_html/wp-content/plugins/wc-multivendor-marketplace/views/store/wcfmmp-view-store-art-works.php’ for inclusion (include_path=’.:/usr/local/php73/pear’) in /home/rifftrad/public_html/wp-content/plugins/wc-multivendor-marketplace/core/class-wcfmmp-template.php on line 38

    Plugin Author WC Lovers

    (@wclovers)

    Opps! Do you have removed that template from child theme’s “wcfm/store” folder?

    Thread Starter marzmuso

    (@marzmuso)

    Hi,

    No, I didn’t remove any folder from Rehub / wcfm.

    I just created the folders wcfm and store in my grandchild plugin which handles custom code for rehub and put php file inside store folder as you instructed.

    Plugin Author WC Lovers

    (@wclovers)

    But this was working for you!

    Only short code was not rendering. DO you have change anything?

    Thank You

    Plugin Author WC Lovers

    (@wclovers)

    Are you able to make this working?

    Thread Starter marzmuso

    (@marzmuso)

    Hi,
    No I cannot get it working. Only tab will show but not one shortcode renders.

    ??

    Plugin Author WC Lovers

    (@wclovers)

    Hi,

    Do you have added normal text in that template? Are those showing!

    May be there has some issue to render short code!

    Thank You

    Thread Starter marzmuso

    (@marzmuso)

    Hi,

    Yes normal text is showing. But no graphic elements of the template.

    Is there Any way you can add this feature to the plugin modules ?

    Best Regards

    Thread Starter marzmuso

    (@marzmuso)

    Please can you help. There is a problem in Rehub theme with this code ?

    Update: Not even text is showing ?

    • This reply was modified 5 years, 6 months ago by marzmuso.
Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Custom Tab On Vendor Store page Not Showing?’ is closed to new replies.