segment-boneyard / analytics-wordpress

[DEPRECATED] The hassle-free way to integrate analytics into any WordPress site.
https://segment.com/docs/platforms/wordpress/
GNU General Public License v2.0
41 stars 34 forks source link

Woocommerce "Add to Cart" cause PHP Fatal Error #47

Open flystax opened 9 years ago

flystax commented 9 years ago

Hi there,

I downloaded the plugin and installed on my woocommerce store. Once I click the "Add to Cart" button on the products, it showed up a PHP Fatal Error, please see log below:

[Thu Oct 09 03:01:36.380979 2014] [:error] [pid 21246] PHP Fatal error: Call to undefined function WC() in /wp-content/plugins/segment-analytics/integrations/ecommerce/woocommerce.php on line 107

JustinSainton commented 9 years ago

Thanks for the report, @flystax.

This sounds like there might be a weird configuration issue occurring, as the function that is called within should only ever be called after WC() is instantiated, but I think we should be able to harden this up a bit. Thanks again for the report, we'll assess a fix for the next release.