Title: Global WooCommerce
Last modified: July 27, 2017

---

# Global WooCommerce

 *  [linahammad](https://wordpress.org/support/users/linahammad/)
 * (@linahammad)
 * [9 years ago](https://wordpress.org/support/topic/global-woocommerce/)
 * Hi
    I am new WooCommerce and WordPress developer. I am currently developing a
   custom payment method, after checkout process (place order button) I redirect
   the user to my website to fill the credit card form when the process is done 
   I return the user to thank you page or failure page in the WooCommerce website(
   online store). The problem is when I want to empty the cart I couldn’t use the
   global $woocommerce due to an undefined global variable, even when I try to put
   it in the PHP session and read it again, I got this error __PHP_Incomplete_Class
   Object.
 * any one can help or have an idea to make this run.

Viewing 1 replies (of 1 total)

 *  [kursora](https://wordpress.org/support/users/kursora/)
 * (@kursora)
 * [9 years ago](https://wordpress.org/support/topic/global-woocommerce/#post-9369382)
 * Try WC() function instead global $woocommerce.

Viewing 1 replies (of 1 total)

The topic ‘Global WooCommerce’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3640790)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [kursora](https://wordpress.org/support/users/kursora/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/global-woocommerce/#post-9369382)
 * Status: not resolved