Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Raul Illana

    (@raulillana)

    Hi Jose.

    Let me say that WooCommerce customers are just normal WP users, so this is weird.

    I think you should try something like this in the widget output code to point you in the right direction:

    global $woocomerce; print_r($woocommerce);

    For a custom development you contact me on my website anyway, but you should give it another shoot first as it sounds as a problem in your configuration or development. ??

    Best wishes.
    R

    Thread Starter xemita

    (@xemita)

    Hi Raul,

    Thanks for the quick reply.

    Actually, Woocommerce users have a different new role, they are “Customers”, not suscriptors.

    I’ve tested it and the users show online if they are administrators, editors, etc, all roles except Customers.

    So, before contacting you through your website, we would like to know if it’s even possible to show the Woocommerce Customers role.

    Kind regards.

    Plugin Author Raul Illana

    (@raulillana)

    Hi again:

    Look for this code in main file (widget() function):

    // only showing roles
    $onlys = array(
    	'Super Administrator' => $instance['aws_oruw_osuadms'],
    	'Administrator'       => $instance['aws_oruw_oadms'],
    	'Editor'              => $instance['aws_oruw_oedits'],
    	'Author'              => $instance['aws_oruw_oauths'],
    	'Contributor'         => $instance['aws_oruw_oconts'],
    	'Subscriber'          => $instance['aws_oruw_osubs']
    );

    Change it with:

    // only showing roles
    $onlys = array(
    	'Super Administrator' => $instance['aws_oruw_osuadms'],
    	'Administrator'       => $instance['aws_oruw_oadms'],
    	'Editor'              => $instance['aws_oruw_oedits'],
    	'Author'              => $instance['aws_oruw_oauths'],
    	'Contributor'         => $instance['aws_oruw_oconts'],
    	'Subscriber'          => $instance['aws_oruw_osubs'],
    	'Customer'            => ''
    );

    Also, if you look at the plugin code you can see this:

    // if any 'show only' role selected, construct an array with the selected roles only
    if( in_array(true, $oroles, true) ) foreach( $oroles as $key => $rol ) ($rol == 1 ? $roles[] .= $key : '');
    // else construct an array with all the roles
    else foreach( $oroles as $key => $rol ) $roles[] .= $key;

    So you must not have any roles in show only mode.

    I’m pretty sure this will do the trick.

    Best! ??
    R

    Thread Starter xemita

    (@xemita)

    Raul,

    Thanks for the quick reply.

    I’ve modified the widget function and checked the second step but I couldn’t make it work.

    Do we have to write something here?
    ‘Customer’ => ”

    Something like “instance”?

    Thanks again once more.

    Plugin Author Raul Illana

    (@raulillana)

    Hi Jose.

    Sorry, forums didn’t let me login yesterday to reply… :\

    A 0 will be enough there to don’t show only Customers.

    I don’t have time to test it now, but you’re in the right way.
    Remember to put here your solution and close the thread when u got it, for future reference.

    Or if you still consider a donation to get this done, let’s talk. ??

    Thread Starter xemita

    (@xemita)

    Couldn’t make it work, thanks anyway.

    Plugin Author Raul Illana

    (@raulillana)

    No problem, mate.

    I will take some time for an update soon, i hope. ^^’

    Best!
    R

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Include online Woocommerce customers to dashboard’ is closed to new replies.