WPGeodirectory + WC MarketPlace = bug
This topic contains 16 replies, has 3 voices, and was last updated by patripat 7 years, 4 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
October 2, 2017 at 11:24 am #398443
Hi Guys,
i’m trying to do the multi vendor thing on Toutwat.be so this is what i did :
– installed woocommerce and got information that GDF Modern is not compatible, so i found this bit of code, made a snippet with it and the warning went away :
// unhook default woo wrappers
remove_action(‘woocommerce_before_main_content’, ‘woocommerce_output_content_wrapper’, 10);
remove_action(‘woocommerce_after_main_content’, ‘woocommerce_output_content_wrapper_end’, 10);// hook in our new theme wrappers
add_action(‘woocommerce_before_main_content’, ‘gbb_theme_wrapper_start’, 10);
add_action(‘woocommerce_after_main_content’, ‘gbb_theme_wrapper_end’, 10);function gbb_theme_wrapper_start() {
get_template_part(‘template-part’, ‘head’);
get_template_part(‘template-part’, ‘topnav’);
echo ‘<div class=”container” >
<div class=”row”>
<div class=”col-md-8″> This column is 8 column width‘;
}function gbb_theme_wrapper_end() {
echo ‘</div>’; // close col-md8
// sidebar column (right aligned)
echo ‘<div class=”col-md-4″> This column is 4 column width <br/>’;
get_sidebar(‘shop’); // woocommerce sidebar (see sidebar.php)
echo ‘</div>’; // close sidebar columnecho ‘</div>’; // close row
echo ‘</div>’; // close container
}// declare woo support
add_action(‘after_setup_theme’, ‘woocommerce_support’);function woocommerce_support() {
add_theme_support(‘woocommerce’);
}/* see sidebar.php to see sidebar-1 (which woocommerce takes to be ‘shop’ sidebar */
function gbb_widgets_init() {
register_sidebar(array(
‘name’ => __(‘GB Default Sidebar’, ‘stick_themename_or_textdomain_here’),
‘id’ => ‘sidebar-1’,
‘description’ => ”,
‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</aside>’,
‘before_title’ => ‘<h3 class=”widget-title”>’,
‘after_title’ => ‘</h3>’,
));
}add_action(‘widgets_init’, ‘gbb_widgets_init’);
After that, i installed several multivendor plugins which gave me a terrible headache and finally WCMP did the trick…
At first nothing worked, needed to save permalinks and the menus and all that are ok, now i try to use the “add a product” from frontend feature (it links to a limited backend panel where vendors can add and manage products) it drives me to the website homepage
Then i disabled all plugins but woocommerce and wcmp, hit add product and it worked correctly, then enabled Geodirectory and hit add product, back to homepage…
I did a lot of research and am not at all willing to follow wcmp advice and disable geodirectory (…) so i wondered if you guys could help me with a snippet to get this working correctly please?
Thanks a lot in advance and best regards,
PatrickOctober 2, 2017 at 11:28 am #398444This reply has been marked as private.October 2, 2017 at 3:21 pm #398476Please check now, by dfault we block users from the backend, i disabled that setting under GD>General and it now seems to work.
Stiofan
October 2, 2017 at 4:58 pm #398528Hi Stiofan,
you are my guru 🙂 Thanks!
Just a thing, i just connected with the vendor account and it seems that with enabling backend access in GD>General it gives “vendors” access to a lot more then just what would be related to WooCommerce and adding a product…Any idea how i can solve that? I already had a look but could not find a plugin that restricts access to some parts of the backend to a category of user…
Thanks a lot!
PatrickOctober 2, 2017 at 5:10 pm #398529Try the “Members” plugin that should allow you.
Stiofan
October 2, 2017 at 5:41 pm #398540think i did something wrong, installed “members” and checked disable for anything that did not show “enable” for vendor and now i can’t access add a product again…now i disabled “members” and when i hit products management it drives me to “my account”…will post result if i got it resolved (any idea is welcome 🙂 )
October 2, 2017 at 5:50 pm #398543You will need to be careful 🙂 You might need to check a fresh install to get the default settings.
Stiofan
October 2, 2017 at 6:09 pm #398547been careful enough to run a backup every morning hahaha 🙂
i’ll ask wcmp for support, thanks for your help Stiofan, members plugin is way too advanced for me 🙂
Have a nice evening,
PatOctober 2, 2017 at 6:11 pm #398549Thanks Pat, you too! 🙂
October 4, 2017 at 10:04 am #398743This reply has been marked as private.October 4, 2017 at 10:29 am #398746This reply has been marked as private.October 4, 2017 at 12:03 pm #398763resolved with the following code, might be useful for other people willing to do the multi vendor thing, this code will allow to use WC Marketplace and hide admin menu from “wcmp_vendor” class of user :
function remove_menus(){
$user_id = get_current_user_id();
if(is_user_wcmp_vendor($user_id)){remove_menu_page( ‘index.php’ ); //Dashboard
remove_menu_page( ‘edit.php?post_type=gd_place’ ); //WPGD*
remove_menu_page( ‘edit.php?post_type=gd_event’ ); //Events*
remove_menu_page( ‘edit.php?post_type=gd_list’ ); //List*
remove_menu_page( ‘edit.php’ ); //Posts
remove_menu_page( ‘upload.php’ ); //Media
remove_menu_page( ‘edit.php?post_type=page’ ); //Pages
remove_menu_page( ‘edit-comments.php’ ); //Comments
remove_menu_page( ‘themes.php’ ); //Appearance
remove_menu_page( ‘plugins.php’ ); //Plugins
remove_menu_page( ‘users.php’ ); //Users
remove_menu_page( ‘tools.php’ ); //Tools
remove_menu_page( ‘options-general.php’ ); //Settings}
}
add_action( ‘admin_menu’, ‘remove_menus’ );Now chasing a way to remove items from the top admin menu bar
Dear admins, is it ok if i keep posting snippets until i got it perfect? Other people may be struggling with that…Thank you,
PatOctober 4, 2017 at 12:27 pm #398775Thanks for sharing Pat!
October 4, 2017 at 12:37 pm #398781this one will remove the +New menu on the top bar that is filled with everything we can add as an admin :
function wpse_260669_remove_new_content(){
global $wp_admin_bar;
$wp_admin_bar->remove_menu( ‘new-content’ );
}
add_action( ‘wp_before_admin_bar_render’, ‘wpse_260669_remove_new_content’ );October 4, 2017 at 1:29 pm #398800and finally for those who (like me) are using somehow psycho plugins that wont hide with the snippet above (blog2social is one of them), you can use this snippet :
function remove_blog2social_menu() {
remove_menu_page(‘blog2social’);
}
add_action( ‘admin_menu’, ‘remove_blog2social_menu’, 999);All of the snippets above are used in ToutWat.be in order to create a multi-vendor online shop with WooCommerce and WC Marketplace.
Shops will not appear or be linked to places, it is linked to users
The idea is : user claims business and he can request vendor status
GeoDirectory not being designed for such addons, i struggled for 4 days and with the information provided from Stiofan i could resolve every issue (mainly vendor backend showing half of full admin backend)
What is not so nice : i could hide admin menus but not disable them for “wcmp_vendor”
What is also not so nice : these multi vendor things do not allow places owners to setup their payment gateways so i needed to setup PayPal Adaptive and i believe it makes things complicatedThese are my thoughts on day -1 before production release 🙂
Have a nice day and thanks for your help,
Pat -
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket