WordPress.org

Ready to get started?Download WordPress

Forums

Awebsome! Online Registered Users Widget
Include online Woocommerce customers to dashboard (8 posts)

  1. Jose
    Member
    Posted 3 months ago #

    Hi,

    Fantastic plugin but I can't make it work to see the woocommerce customers that are online.

    We could make a donation to make this improvement, how can we contact you?

    Kind regards.

    http://wordpress.org/plugins/awebsome-online-registered-users-widget/

  2. Raul Illana
    Member
    Plugin Author

    Posted 3 months ago #

    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

  3. Jose
    Member
    Posted 3 months ago #

    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.

  4. Raul Illana
    Member
    Plugin Author

    Posted 3 months ago #

    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

  5. Jose
    Member
    Posted 3 months ago #

    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.

  6. Raul Illana
    Member
    Plugin Author

    Posted 3 months ago #

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

  7. Jose
    Member
    Posted 3 months ago #

    Couldn't make it work, thanks anyway.

  8. Raul Illana
    Member
    Plugin Author

    Posted 3 months ago #

    No problem, mate.

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

    Best!
    R

Reply

You must log in to post.

About this Plugin

About this Topic