Title: Fatal Error (PHP)
Last modified: October 2, 2017

---

# Fatal Error (PHP)

 *  [arcearte](https://wordpress.org/support/users/arcearte/)
 * (@arcearte)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/fatal-error-php-4/)
 * The plugin works perfect when navigate the site, but when I try to edit any page
   that contains the shortcode getting this error:
 * Fatal error: Uncaught Error: Call to a member function get_cart_contents_count()
   on null in /homepages/31/d221571097/htdocs/clickandbuilds/Robeca/wp-content/plugins/
   woo-cart-count-shortcode/woocommerce-cart-count-shortcode.php:35 Stack trace:#
   0 /homepages/31/d221571097/htdocs/clickandbuilds/Robeca/wp-includes/shortcodes.
   php(345): woocommerce_cart_count_shortcode(Array, ”, ‘cart_button’) #1 [internal
   function]: do_shortcode_tag(Array) #2 /homepages/31/d221571097/htdocs/clickandbuilds/
   Robeca/wp-includes/shortcodes.php(223): preg_replace_callback(‘/\\[(\\[?)(cart_b…’,‘
   do_shortcode_ta…’, ‘<p><span>[cart_…’) #3 /homepages/31/d221571097/htdocs/clickandbuilds/
   Robeca/wp-content/themes/Divi/includes/builder/class-et-builder-element.php(720):
   do_shortcode(‘<p><span>[cart_…’) #4 /homepages/31/d221571097/htdocs/clickandbuilds/
   Robeca/wp-includes/shortcodes.php(345): ET_Builder_Element->_shortcode_callback(
   Array, ‘<p><span>[cart_…’, ‘et_pb_text’) #5 [internal function]: do_shortcode_tag(
   Array) #6 /homepages/31/d221571097/h in /homepages/31/d221571097/htdocs/clickandbuilds/
   Robeca/wp-content/plugins/woo-cart-count-shortcode/woocommerce-cart-count-shortcode.
   php on line 35
 * Wordpress Ver.: 4.8.2
    WooCommerce Cart Count Shortcode: 1.0.4 WooCommerce Ver.:
   3.1.2
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffatal-error-php-4%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [prontotools](https://wordpress.org/support/users/prontotools/)
 * (@prontotools)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/fatal-error-php-4/#post-9586206)
 * Hi arcearte,
 * We just found this kind of problem last week and push the fix in the latest version.
   We will see more if something caused this problem. Thanks!
 * Regards,
    Natty
 *  Plugin Author [prontotools](https://wordpress.org/support/users/prontotools/)
 * (@prontotools)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/fatal-error-php-4/#post-9586300)
 * Hi arcearte,
 * I’ve tried with the same version as you mentioned but my localhost is working
   as expected. I’ve installed both woocommerce 3.2.1(latest) and 3.1.2 with the
   same WordPress and woo-cart-count version as you.
 * Could please make sure you install latest Woocommerce and woo-cart-count?
 * Thanks,
 * Natty
 *  [toyo1984](https://wordpress.org/support/users/toyo1984/)
 * (@toyo1984)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-php-4/#post-10090243)
 * Hi There
    Just uploaded the plug-in, great stuff! However, when trying to go 
   into Elementor, I am getting the same PHP Fatal error description as mentioned
   in this post. I’m running WC version 3.33/ WordPress Ver.: 4.9.4 WooCommerce 
   Cart Count Shortcode: 1.0.4
 * Thanks for your support!

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

The topic ‘Fatal Error (PHP)’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/woo-cart-count-shortcode_5c6fa5.svg)
 * [WooCommerce Cart Count Shortcode](https://wordpress.org/plugins/woo-cart-count-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/woo-cart-count-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-cart-count-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-cart-count-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-cart-count-shortcode/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [toyo1984](https://wordpress.org/support/users/toyo1984/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-php-4/#post-10090243)
 * Status: not resolved