Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #550292

    Hello,

    I use a plugin called WC Vendors to build a marketplace (several vendors on a Woocommerce foundation).
    I need to be able to display a list of vendors in the menu.

    Guys at WC Vendors gave some code to be included in functions.php

    But should I include in functions.php or functions-enfold.php ?
    Thanks.

    Below the code itself.

    
    /* BEGIN WC Vendors Pro */
    add_filter( 'wp_nav_menu_items', 'wcv_vendors_menu', 10, 2 );
    function wcv_vendors_menu ( $items, $args ) {
             if ($args->theme_location == 'primary') {
                    $vendors  = get_users( array( 'role' => 'vendor' ) );
                    $items .= '<li><a href="#">Vendors</a>';
                    $items .= '<ul class="sub-menu">';
                    foreach( $vendors as $vendor ) {
                            $store_url = WCVendors_Pro_Vendor_Controller::get_vendor_store_url($vendor->ID);
                            $store_id = WCVendors_Pro_Vendor_Controller::get_vendor_store_id( $vendor->ID );
                            $store_name = get_post_field( 'post_title', $store_id );
                            $items .= '<li><a href="'.$store_url.'">'.$store_name.'</a></li>';
                    }
                    $items .= '</ul></li>';
            }
        return $items;
    }
    /* END WC Vendors Pro */
    • This topic was modified 8 years, 3 months ago by nberdugo.
    #550340

    Hey nberdugo!

    You should add the code to functions.php file and to keep your changes update safe, please use a child theme

    Regards,
    Yigit

    #550465

    Hello Yigit

    Thanks very much, I just did that.
    It does not work though.
    The code is supposed to display a menu with the vendor stores (for all user whose role is “vendor”).

    Based on the way Enfold works, so you see what could be wrong with this code? The developers told me it might need to be adapted depending on how the theme is working…

    #550736

    Hi!

    The code seems to be OK, but you would need to consult the WC Vendor developers, for further assistance on the issue as the problem is not related to enfold.

    Please let us know if you have any more questions regarding our theme.

    Cheers!
    Basilis

    #550740

    Yes, unfortunately their answer is : If it doesnt show up on your site, it’s a matter of you debugging how your theme handles the menus and sorting it out from there.

    So the call to the menu is correct, right?

    #553028

    Hey!

    if the plugin’s author can’t help you, then you would need to hire a freelance developer to make this plugin compatible: http://kriesi.at/contact/customization

    Best regards,
    Andy

    #678621

    Hey nberdugo,

    Did you ever got that issue fixed? i would like to know since I’m trying to do the same thing

    regards,

    #679504

    Hi,

    Please try adding following shortcode into navigation field in Appearance > Menus

    [wcv_vendorslist]

    Best regards,
    Yigit

    #689211

    normaly you can make a page with this shortcode:

    [wcv_pro_vendorslist]

    and add this page to the menue.

    #689216

    Hi!


    @jobhopper
    Thanks for your input :)

    Best regards,
    Yigit

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.