Check for WC()->cart object before using
Merge branch 'master' of github.com:segmentio/analytics-wordpress