Make WordPress Core

#51398 closed defect (bug) (invalid)

Bug: Notice: Trying to get property ‘earnings’ of non-object...

Reported by: principianteweb Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

I was having some trouble with my web so I decided to debug it and this is what I got:

Notice: Trying to get property ‘earnings’ of non-object in /home4/consumol/public_html/wp-content/plugins/dokan-lite/includes/functions.php on line 376

I’m not sure how to fix it but I’ll show you how does that line looks hoping you can help me (the line 376 is the one that says $earnings = $count->earnings; ) :

$cache_group = ‘dokan_seller_data_’ . $seller_id;
$cache_key = ‘dokan-earning-‘ . $seller_id;
$earnings = wp_cache_get( $cache_key, $cache_group );

if ( $earnings === false ) {
$count = $wpdb->get_row(
$wpdb->prepare( “SELECT SUM(order_total) as earnings FROM {$wpdb->prefix}dokan_orders WHERE seller_id = %d AND order_status IN(‘wc-completed’, ‘wc-processing’, ‘wc-on-hold’)”, $seller_id )

$earnings = $count->earnings;

wp_cache_set( $cache_key, $earnings, $cache_group );
dokan_cache_update_group( $cache_key, $cache_group );

return apply_filters( ‘dokan_seller_total_sales’, $earnings );

* Generate dokan sync table
* @deprecated since 2.4.3
* @global WPDB $wpdb

I had a thread on the forum and the developers (@sohanhossain and @rur165) asked me to create a support ticket so you can help me to solve my problem.

My website: https://consumo-local.com.mx/leon/

Change History (1)

#1 @SergeyBiryukov
15 months ago

  • Description modified (diff)
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Hi there, welcome to WordPress Trac! Thanks for the ticket.

I'm sorry to hear you are having issues with your website. Please note that this Trac is used for enhancements and bug reporting for the WordPress core software, not for third-party plugins like Dokan, or individual support questions.

When asking you to create a support ticket, it looks like the Dokan developers referred to their own site for that:

I request you to open a support ticket from the contact page of our site and share your site details there.

So https://wedevs.com/contact would be the proper place for this report. There is an "I have a Technical Question" section on the right, with a "Submit a Ticket" link.

Note: See TracTickets for help on using tickets.