[wp-trac] [WordPress Trac] #51398: Bug: Notice: Trying to get property ‘earnings’ of non-object...

WordPress Trac noreply at wordpress.org
Sat Sep 26 19:33:34 UTC 2020


#51398: Bug: Notice: Trying to get property ‘earnings’ of non-object...
-----------------------------+----------------------
 Reporter:  principianteweb  |       Owner:  (none)
     Type:  defect (bug)     |      Status:  closed
 Priority:  normal           |   Milestone:
Component:  General          |     Version:
 Severity:  normal           |  Resolution:  invalid
 Keywords:                   |     Focuses:
-----------------------------+----------------------
Changes (by SergeyBiryukov):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Old description:

> 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/

New description:

 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/

--

Comment:

 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 [https://wordpress.org/support/topic/dokan-doesnt-show-the-
 orders/#post-13450642 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51398#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list