• After concluding an order, an error apears refearing to the comissions payment. it doesn′t send the actual comission to the comissions management page.

    Fatal error: Call to a member function commissions_to_pay() on a non-object in /home/portug24/public_html/wp-content/plugins/yith-woocommerce-multi-vendor-premium/includes/class.yith-vendors-credit.php on line 130

    What can i do?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi @joaoalbuquerque, this is strange error because I tested the plugin in local and works fine.
    However, I added a fix for this and you find it in next plugin release. To fix it please open the file class.yith-vendors-credit.php located in wp-content/plugins/yith-woocommerce-multi-vendor-premium/includes/ and go to line 130, you find this code:

     
    // save the amount to pay for each commission of vendor
    foreach ( $vendor->commissions_to_pay() as $commission_id ) {
        $commission = YITH_Commission( $commission_id );
        $data[] = array(
            'paypal_email' => $vendor->paypal_email,
            'amount' => round( $commission->get_amount(), 2 ),
            'request_id' => $commission->id
        );
    
        // save the commissions with other to set 'paid' after success payment
        $commissions[] = $commission;
    }
    

    Please, replace the previous code with this instead:

    
    if( $vendor instanceof YITH_Vendor && $vendor->is_valid() ){
    	// save the amount to pay for each commission of vendor
    	foreach ( $vendor->commissions_to_pay() as $commission_id ) {
    	    $commission = YITH_Commission( $commission_id );
    	    $data[] = array(
    	        'paypal_email' => $vendor->paypal_email,
    	        'amount' => round( $commission->get_amount(), 2 ),
    	        'request_id' => $commission->id
    	    );
    
    	    // save the commissions with other to set 'paid' after success payment
    	    $commissions[] = $commission;
    	}
    }
    

    This fixed code solve your issue.
    Thanks for your reporting.
    Have a nice day
    YITH

    • This reply was modified 8 years, 2 months ago by YITHEMES. Reason: edit code
    Thread Starter joaoalbuquerque

    (@joaoalbuquerque)

    an new error appeared

    Parse error: syntax error, unexpected ‘public’ (T_PUBLIC) in /home/portug24/public_html/wp-content/plugins/yith-woocommerce-multi-vendor-premium/includes/class.yith-vendors-credit.php on line 168

    My site is down

    Thread Starter joaoalbuquerque

    (@joaoalbuquerque)

    on line 168, i made it a comment by inserting // and the error is gone.

    However, the comissions managing page ain′t updating.
    What can i do?

    Plugin Author YITHEMES

    (@yithemes)

    Hi,

    you make an error during editing file, probably missing a }
    I advice you to delete the multi vendor plugin and upload it again, you have a corrupted file.
    Let me know.

    Have a nice day
    YITH

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘commissions fatal error’ is closed to new replies.