• Hello Support Team,
    We just want to share the fatal error we encountered when clicking the “Add to Cart” button. The cart page is not loading due to this fatal error.

    PHP Fatal error: ?Uncaught TypeError: Automattic\WooCommerce\StoreApi\Schemas\V1\CartItemSchema::get_cart_images(): Argument #3 ($cart_item_key) must be of type string, null given, called in /var/www/html/wordpress/wp-content/plugins/woocommerce_latest/src/StoreApi/Schemas/V1/CartItemSchema.php on line 74 and defined in /var/www/html/wordpress/wp-content/plugins/woocommerce_latest/src/StoreApi/Schemas/V1/CartItemSchema.php:99Stack trace:#0 /var/www/html/wordpress/wp-content/plugins/woocommerce_latest/src/StoreApi/Schemas/V1/CartItemSchema.php(74): Automattic\WooCommerce\StoreApi\Schemas\V1\CartItemSchema->get_cart_images()#1 [internal function]: Automattic\WooCommerce\StoreApi\Schemas\V1\CartItemSchema->get_item_response()#2 /var/www/html/wordpress/wp-content/plugins/woocommerce_latest/src/StoreApi/Schemas/V1/AbstractSchema.php(285): array_map()#3 /var/www/html/wordpress/wp-content/plugins/woocommerce_latest/src/StoreApi/Schemas/V1/CartSchema.php(352): Automattic\WooCommerce\StoreApi\Schemas\V1\AbstractSchema->get_item_responses_from_schema()#4 /var/www/html/wordpress/wp-content/plugins/woocommerce_latest/src/StoreApi/Routes/V1/Cart.php(59): Automattic\WooCommerce\StoreApi\Schemas\V1\CartSchema->get_item_response()#5 /var/www/html/wordpress/wp-content/plugins/woocommerce_latest/src/StoreApi/Routes/V1/AbstractRoute.php(126): Automattic\WooCommerce\StoreApi\Routes\V1\Cart->get_route_response()#6 /var/www/html/wordpress/wp-content/plugins/woocommerce_latest/src/StoreApi/Routes/V1/AbstractCartRoute.php(125): Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method()#7 [internal function]: Automattic\WooCommerce\StoreApi\Routes\V1\AbstractCartRoute->get_response()#8 /var/www/html/wordpress/wp-content/plugins/woocommerce_latest/src/Blocks/Domain/Services/Hydration.php(155): call_user_func_array()#9 /var/www/html/wordpress/wp-content/plugins/woocommerce_latest/src/Blocks/Domain/Services/Hydration.php(65): Automattic\WooCommerce\Blocks\Domain\Services\Hydration->get_response_from_controller()#10 /var/www/html/wordpress/wp-content/plugins/woocommerce_latest/src/Blocks/Assets/AssetDataRegistry.php(322): Automattic\WooCommerce\Blocks\Domain\Services\Hydration->get_rest_api_response_data()#11 /var/www/html/wordpress/wp-content/plugins/woocommerce_latest/src/Blocks/BlockTypes/Cart.php(257): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->hydrate_api_request()#12 /var/www/html/wordpress/wp-content/plugins/woocommerce_latest/src/Blocks/BlockTypes/AbstractBlock.php(416): Automattic\WooCommerce\Blocks\BlockTypes\Cart->enqueue_data()#13 /var/www/html/wordpress/wp-content/plugins/woocommerce_latest/src/Blocks/BlockTypes/Cart.php(147): Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock->enqueue_assets()#14 /var/www/html/wordpress/wp-content/plugins/woocommerce_latest/src/Blocks/BlockTypes/AbstractBlock.php(96): Automattic\WooCommerce\Blocks\BlockTypes\Cart->enqueue_assets()#15 /var/www/html/wordpress/wp-includes/class-wp-block.php(537): Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock->render_callback()#16 /var/www/html/wordpress/wp-includes/blocks.php(2191): WP_Block->render()#17 /var/www/html/wordpress/wp-includes/blocks.php(2243): render_block()#18 /var/www/html/wordpress/wp-includes/class-wp-hook.php(324): do_blocks()#19 /var/www/html/wordpress/wp-includes/plugin.php(205): WP_Hook->apply_filters()#20 /var/www/html/wordpress/wp-includes/post-template.php(256): apply_filters()#21 /var/www/html/wordpress/wp-content/themes/astra/template-parts/single/content-header.php(37): the_content()#22 /var/www/html/wordpress/wp-includes/template.php(812): require('...')#23 /var/www/html/wordpress/wp-includes/template.php(745): load_template()#24 /var/www/html/wordpress/wp-includes/general-template.php(206): locate_template()#25 /var/www/html/wordpress/wp-content/themes/astra/inc/template-parts.php(374): get_template_part()#26 /var/www/html/wordpress/wp-includes/class-wp-hook.php(324): astra_entry_content_single_page_template()#27 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()#28 /var/www/html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()#29 /var/www/html/wordpress/wp-content/themes/astra/inc/core/theme-hooks.php(450): do_action()#30 /var/www/html/wordpress/wp-content/themes/astra/template-parts/content-page.php(28): astra_entry_content_single_page()#31 /var/www/html/wordpress/wp-includes/template.php(812): require('...')#32 /var/www/html/wordpress/wp-includes/template.php(745): load_template()#33 /var/www/html/wordpress/wp-includes/general-template.php(206): locate_template()#34 /var/www/html/wordpress/wp-content/themes/astra/inc/class-astra-loop.php(110): get_template_part()#35 /var/www/html/wordpress/wp-includes/class-wp-hook.php(324): Astra_Loop->template_parts_page()#36 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()#37 /var/www/html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()#38 /var/www/html/wordpress/wp-content/themes/astra/inc/class-astra-loop.php(198): do_action()#39 /var/www/html/wordpress/wp-content/themes/astra/inc/class-astra-loop.php(175): Astra_Loop->loop_markup()#40 /var/www/html/wordpress/wp-includes/class-wp-hook.php(324): Astra_Loop->loop_markup_page()#41 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()#42 /var/www/html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()#43 /var/www/html/wordpress/wp-content/themes/astra/inc/core/theme-hooks.php(265): do_action()#44 /var/www/html/wordpress/wp-content/themes/astra/page.php(32): astra_content_page_loop()#45 /var/www/html/wordpress/wp-includes/template-loader.php(106): include('...')#46 /var/www/html/wordpress/wp-blog-header.php(19): require_once('...')#47 /var/www/html/wordpress/index.php(17): require('...')#48 {main}? thrown in /var/www/html/wordpress/wp-content/plugins/woocommerce_latest/src/StoreApi/Schemas/V1/CartItemSchema.php on line 99

    So, we want to know why this is happening. Also, we have tried it on localhost with only one active plugin, which is WooCommerce.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Jonayed (woo-hc)

    (@jonayedhosen)

    Hi @wisdmlabs ,

    Thanks for reaching out. I understand you’re experiencing an issue where clicking the “Add to Cart” button prevents the cart page from loading due to a fatal error.

    It looks like you’re facing this issue on WooCommerce 9.6.1/9.6.2, and WooCommerce 9.7.0 has since been released. I recommend updating the plugin first to see if that resolves the issue.

    If you’ve already deactivated all plugins except WooCommerce and the issue persists, it could be related to your theme or custom code. In that case, try switching to the default Storefront theme and temporarily removing any custom code from your site.

    If the issue continues, reviewing your System Status Report would help us gain more insight into your setup. You can find this report in your WooCommerce dashboard under WooCommerce > Status. From there, select Get system report and then Copy for support.

    Additionally, if there are any fatal error logs, please share them as well. These can be accessed under WooCommerce > Status > Logs.

    Once you’ve gathered this information, please paste it into a Code block in your reply or use Pastebin to share the link with us.

    Let us know what you find!

    Thread Starter WisdmLabs

    (@wisdmlabs)

    Please refer to the system reports and logs.

    https://pastebin.com/qjNetErQ

    Here are my logs, and you can see the fatal error.

    2025-02-27T05:12:10+00:00 Critical Uncaught TypeError: Automattic\WooCommerce\StoreApi\Schemas\V1\CartItemSchema::get_cart_images(): Argument #3 ($cart_item_key) must be of type string, null given, called in /var/www/html/wordpress/wp-content/plugins/woocommerce/src/StoreApi/Schemas/V1/CartItemSchema.php on line 69 and defined in /var/www/html/wordpress/wp-content/plugins/woocommerce/src/StoreApi/Schemas/V1/CartItemSchema.php:94  
    Additional context
    2025-02-27T05:13:14+00:00 Critical Uncaught TypeError: Automattic\WooCommerce\StoreApi\Schemas\V1\CartItemSchema::get_cart_images(): Argument #3 ($cart_item_key) must be of type string, null given, called in /var/www/html/wordpress/wp-content/plugins/woocommerce/src/StoreApi/Schemas/V1/CartItemSchema.php on line 69 and defined in /var/www/html/wordpress/wp-content/plugins/woocommerce/src/StoreApi/Schemas/V1/CartItemSchema.php:94
    Additional context
    2025-02-27T05:13:33+00:00 Critical Uncaught TypeError: Automattic\WooCommerce\StoreApi\Schemas\V1\CartItemSchema::get_cart_images(): Argument #3 ($cart_item_key) must be of type string, null given, called in /var/www/html/wordpress/wp-content/plugins/woocommerce/src/StoreApi/Schemas/V1/CartItemSchema.php on line 69 and defined in /var/www/html/wordpress/wp-content/plugins/woocommerce/src/StoreApi/Schemas/V1/CartItemSchema.php:94

    Please let us know why this is happening and what the reasons are.

    • This reply was modified 2 days, 13 hours ago by WisdmLabs.
    • This reply was modified 2 days, 13 hours ago by WisdmLabs.
    Plugin Support Moses M. (woo-hc)

    (@mosesmedh)

    Hi @wisdmlabs,

    Thank you for sharing those details.

    First, WooCommerce, particularly the Store API used for the cart, requires HTTPS for optimal functionality. An insecure site can interfere with WooCommerce’s ability to manage sessions and cookies, which are essential for the cart feature, and your browser may flag the site as insecure. Please enable SSL on your site.

    Additionally, try temporarily disabling both Edwiser Bridge and its Pro version, then test adding items to the cart again. The issue may be a conflict, possibly between Edwiser and WooCommerce or between your theme and WooCommerce.

    Once both plugins are disabled, and you have SSL active let us know so we can test from our end as well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.