Summary
The Header/Footer Builder Cart Icon can terminate a frontend request when WooCommerce is loaded but its cart object is unavailable.
Expected behavior: The Cart Icon is omitted or otherwise handles an unavailable cart without interrupting page rendering.
Actual behavior: Rendering the Cart Icon calls the cart count on a null object and produces a fatal error.
Impact: Affected frontend pages cannot complete rendering while the Cart Icon is active in this state.
Customer context
- Product / area: Neve Header/Footer Builder Cart Icon
- Version: 4.2.2
- Environment: WordPress 7.0.4; PHP 8.1.34
- Integration / third party: WooCommerce
- Reported error / symptom:
Call to a member function get_cart_contents_count() on null
- Impact: Production crash telemetry recorded 8 frontend occurrences on one site between 2026-08-12 and 2026-08-14.
Reproduction notes
- Activate WooCommerce and configure the Neve Header/Footer Builder Cart Icon.
- Reach a frontend header-rendering request where
WC()->cart is null.
- On Neve
v4.2.2, the Cart Icon template invokes get_cart_contents_count() and the request fatals.
Production telemetry reproduces the resulting error and stack location. The exact condition causing the null cart object is not provided.
Diagnosis
Conclusion
The defect is confirmed for the inspected v4.2.2 source. Its Cart Icon template dereferences WC()->cart at the exact reported line without checking that a WC_Cart object exists. The supplied production stack trace identifies that template and line as the crash location.
Where this likely occurs
header-footer-grid/templates/components/component-cart-icon.php — approx. lines 14-21, template initialization: v4.2.2 calculates $cart_is_empty with WC()->cart->get_cart_contents_count() without a cart-object guard.
header-footer-grid/templates/components/component-cart-icon.php — approx. line 54, rendered cart count: the same unguarded cart-count dereference is present later in the template.
header-footer-grid/Core/Components/CartIcon.php — CartIcon::render_component() in v4.2.2, approx. lines 279-281: loads the template directly. The current branch adds the cart-object guard at lines 279-284 in commit 22bea0edb (fix: validate WC cart object to prevent fatal error).
header-footer-grid/Main.php — Main::load() lines 169-200 loads the component template that appears in the supplied stack trace.
Engineering notes
The crash is in Neve code, not the bundled Themeisle SDK; telemetry also marks SDK involvement as false. The affected code path is reached during frontend header rendering when the Header/Footer Builder Cart Icon is enabled. The source confirms the null dereference but does not establish why WooCommerce's cart object was unavailable for the affected request.
The current branch's guard and the associated regression coverage indicate this failure mode has been recognized after the affected release. The inspected v4.2.2 tag still lacks that guard.
Test coverage status
tests/test-neve-cart-guards.php contains TestNeveCartGuards::test_cart_icon_component_is_empty_when_cart_object_is_missing() at lines 109-119. It stubs WC()->cart as null and asserts the component returns no output. e2e-tests/specs/woocommerce/header-mini-cart.spec.ts covers normal mini-cart interactions, but not an unavailable-cart frontend request. Tests were inspected but not executed.
What to verify or explore next
- Verify the reported frontend workflow with Neve
v4.2.2, WooCommerce active, a null cart object, and the Header/Footer Builder Cart Icon enabled.
- Verify which released Neve version first includes commit
22bea0edb and the null-cart regression test.
- If current releases still generate this fingerprint, inspect the deployed CartIcon source and any template overrides for the guarded render path.
Unknowns / follow-up
- The telemetry does not identify the WooCommerce lifecycle condition, plugin conflict, cache behavior, or custom code that left the cart object null.
- No customer-site reproduction was performed.
Confidence
Confidence: 98/100
The production stack trace resolves directly to Neve's Cart Icon template in v4.2.2, where the cart count is dereferenced without a cart-object guard. The checked release code and a later dedicated regression test confirm the reported null-cart path.
Crash telemetry
|
|
| Occurrences |
8 |
| Distinct sites |
1 |
| First seen |
2026-08-12 18:06 UTC |
| Last seen |
2026-08-14 02:32 UTC |
| Crash location |
product:header-footer-grid/templates/components/component-cart-icon.php:21 |
| Request context |
frontend |
| Inside Themeisle SDK |
no |
| Product versions |
4.2.2 |
| WP versions |
7.0.4 |
| PHP versions |
8.1.34 |
| SDK versions |
3.3.58 |
Source: automated crash report — neve, fingerprint 7738de0560fee7a2d5882edcb41dbb60
Generated by bug-report-triage (ID: bug-report-triage_6a7eaf039c72d3.46611633)
Summary
The Header/Footer Builder Cart Icon can terminate a frontend request when WooCommerce is loaded but its cart object is unavailable.
Expected behavior: The Cart Icon is omitted or otherwise handles an unavailable cart without interrupting page rendering.
Actual behavior: Rendering the Cart Icon calls the cart count on a null object and produces a fatal error.
Impact: Affected frontend pages cannot complete rendering while the Cart Icon is active in this state.
Customer context
Call to a member function get_cart_contents_count() on nullReproduction notes
WC()->cartis null.v4.2.2, the Cart Icon template invokesget_cart_contents_count()and the request fatals.Production telemetry reproduces the resulting error and stack location. The exact condition causing the null cart object is not provided.
Diagnosis
Conclusion
The defect is confirmed for the inspected
v4.2.2source. Its Cart Icon template dereferencesWC()->cartat the exact reported line without checking that aWC_Cartobject exists. The supplied production stack trace identifies that template and line as the crash location.Where this likely occurs
header-footer-grid/templates/components/component-cart-icon.php— approx. lines 14-21, template initialization:v4.2.2calculates$cart_is_emptywithWC()->cart->get_cart_contents_count()without a cart-object guard.header-footer-grid/templates/components/component-cart-icon.php— approx. line 54, rendered cart count: the same unguarded cart-count dereference is present later in the template.header-footer-grid/Core/Components/CartIcon.php—CartIcon::render_component()inv4.2.2, approx. lines 279-281: loads the template directly. The current branch adds the cart-object guard at lines 279-284 in commit22bea0edb(fix: validate WC cart object to prevent fatal error).header-footer-grid/Main.php—Main::load()lines 169-200 loads the component template that appears in the supplied stack trace.Engineering notes
The crash is in Neve code, not the bundled Themeisle SDK; telemetry also marks SDK involvement as false. The affected code path is reached during frontend header rendering when the Header/Footer Builder Cart Icon is enabled. The source confirms the null dereference but does not establish why WooCommerce's cart object was unavailable for the affected request.
The current branch's guard and the associated regression coverage indicate this failure mode has been recognized after the affected release. The inspected
v4.2.2tag still lacks that guard.Test coverage status
tests/test-neve-cart-guards.phpcontainsTestNeveCartGuards::test_cart_icon_component_is_empty_when_cart_object_is_missing()at lines 109-119. It stubsWC()->cartas null and asserts the component returns no output.e2e-tests/specs/woocommerce/header-mini-cart.spec.tscovers normal mini-cart interactions, but not an unavailable-cart frontend request. Tests were inspected but not executed.What to verify or explore next
v4.2.2, WooCommerce active, a null cart object, and the Header/Footer Builder Cart Icon enabled.22bea0edband the null-cart regression test.Unknowns / follow-up
Confidence
Confidence: 98/100
The production stack trace resolves directly to Neve's Cart Icon template in v4.2.2, where the cart count is dereferenced without a cart-object guard. The checked release code and a later dedicated regression test confirm the reported null-cart path.
Crash telemetry
product:header-footer-grid/templates/components/component-cart-icon.php:21Source: automated crash report — neve, fingerprint
7738de0560fee7a2d5882edcb41dbb60Generated by bug-report-triage (ID: bug-report-triage_6a7eaf039c72d3.46611633)