Title: method_exists() expects parameter 2 to be string
Last modified: July 15, 2020

---

# method_exists() expects parameter 2 to be string

 *  Resolved [extaizi](https://wordpress.org/support/users/extaizi/)
 * (@extaizi)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/method_exists-expects-parameter-2-to-be-string/)
 * Suddenly this error started to show up in my website:
 * Warning: method_exists() expects parameter 2 to be string, object given in /home/
   gree/public_html/capacita/wp-content/plugins/woocommerce-direct-checkout/includes/
   view/frontend/general.php on line 75
 * Everything is up to date so far.

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [fcovecino](https://wordpress.org/support/users/fcovecino/)
 * (@fcovecino)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/method_exists-expects-parameter-2-to-be-string/#post-13127868)
 * Hello,
 * Same issue, but not everything is ok… the theme (Divi) styles are being affected.
 * Warning: method_exists() expects parameter 2 to be string, object given in …/
   wp-content/plugins/woocommerce-direct-checkout/includes/view/frontend/general.
   php on line 75
 *  [webparaplan](https://wordpress.org/support/users/webparaplan/)
 * (@webparaplan)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/method_exists-expects-parameter-2-to-be-string/#post-13153975)
 * +1 have same error:
    `PHP Warning: method_exists() expects parameter 2 to be 
   string, object given in /wp-content/plugins/woocommerce-direct-checkout/includes/
   view/frontend/general.php on line 75`
    -  This reply was modified 5 years, 10 months ago by [webparaplan](https://wordpress.org/support/users/webparaplan/).
 *  [libertyking2](https://wordpress.org/support/users/libertyking2/)
 * (@libertyking2)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/method_exists-expects-parameter-2-to-be-string/#post-13159702)
 * I have the same problem and its really affecting my website
 * **Warning: method_exists() expects parameter 2 to be string, object given in /
   home/customer/www/website.com/public_html/wp-content/plugins/woocommerce-direct-
   checkout/includes/view/frontend/general.php on line 75**
    -  This reply was modified 5 years, 10 months ago by [libertyking2](https://wordpress.org/support/users/libertyking2/).
    -  This reply was modified 5 years, 10 months ago by [libertyking2](https://wordpress.org/support/users/libertyking2/).
 *  [Richard](https://wordpress.org/support/users/rgenck/)
 * (@rgenck)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/method_exists-expects-parameter-2-to-be-string/#post-13191907)
 * Same error, it stops people from adding coupons on the cart page.
 *  [Brian Henry](https://wordpress.org/support/users/brianhenryie/)
 * (@brianhenryie)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/method_exists-expects-parameter-2-to-be-string/#post-13192568)
 * The order of the arguments needs to be swapped. Change `/includes/view/frontend/
   general.php:75` from
 * `if (method_exists('is_empty', WC()->cart) && WC()->cart->is_empty()) {`
 * to
 * `if ( method_exists( WC()->cart, 'is_empty' ) && WC()->cart->is_empty() ) {`
 * as per [https://www.php.net/manual/en/function.method-exists.php](https://www.php.net/manual/en/function.method-exists.php)
 *  [Andres Rueda](https://wordpress.org/support/users/andooresu/)
 * (@andooresu)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/method_exists-expects-parameter-2-to-be-string/#post-13235342)
 * Hello there, I have just applied the change proposed by [@brianhenryie](https://wordpress.org/support/users/brianhenryie/)
   and it worked.
 * You need to go to plugins editor, select the direct chekcout plugin and edit 
   the line 75 in the named directory. (/includes/view/frontend/general.php:75) 
   or the one that the warning is telling you to solve.
 * Thank you [@brianhenryie](https://wordpress.org/support/users/brianhenryie/)
 *  Plugin Author [beluserra](https://wordpress.org/support/users/beluserra/)
 * (@beluserra)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/method_exists-expects-parameter-2-to-be-string/#post-13532683)
 * Hi
    sorry for the delay could you test version 2.4.2 and confirm if it is solved
   or not? regards
 *  [fcovecino](https://wordpress.org/support/users/fcovecino/)
 * (@fcovecino)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/method_exists-expects-parameter-2-to-be-string/#post-13554376)
 * Hello,
 * Yes, it seems fixed.
 * Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘method_exists() expects parameter 2 to be string’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-direct-checkout/assets/icon-256x256.jpg?rev=
   2911705)
 * [Direct Checkout for WooCommerce](https://wordpress.org/plugins/woocommerce-direct-checkout/)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-direct-checkout/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-direct-checkout/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-direct-checkout/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-direct-checkout/reviews/)

 * 8 replies
 * 8 participants
 * Last reply from: [fcovecino](https://wordpress.org/support/users/fcovecino/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/method_exists-expects-parameter-2-to-be-string/#post-13554376)
 * Status: resolved