Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

PHP Notice: Undefined index: /wc/store/v1/checkout when placing an order #11649

Closed
jimjasson opened this issue Nov 7, 2023 · 1 comment
Closed
Labels
block: checkout Issues related to the checkout block. type: bug The issue/PR concerns a confirmed bug.

Comments

@jimjasson
Copy link

Describe the bug

When using WooCommerce 8.2.1, Storefront, the cart/checkout block, and legacy order confirmation page; If I purchase a Simple Product, I get this error in the order confirmation page:

[07-Nov-2023 09:19:38 UTC] PHP Notice:  Undefined index: /wc/store/v1/checkout in /Users/dimitrioskytros/Local Sites/wp/app/public/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Domain/Services/Hydration.php on line 51
[07-Nov-2023 09:19:38 UTC] PHP Stack trace:
[07-Nov-2023 09:19:38 UTC] PHP   1. {main}() /Users/dimitrioskytros/Local Sites/wp/app/public/index.php:0
[07-Nov-2023 09:19:38 UTC] PHP   2. require() /Users/dimitrioskytros/Local Sites/wp/app/public/index.php:17
[07-Nov-2023 09:19:38 UTC] PHP   3. require_once() /Users/dimitrioskytros/Local Sites/wp/app/public/wp-blog-header.php:19
[07-Nov-2023 09:19:38 UTC] PHP   4. include() /Users/dimitrioskytros/Local Sites/wp/app/public/wp-includes/template-loader.php:106
[07-Nov-2023 09:19:38 UTC] PHP   5. get_footer($name = *uninitialized*, $args = *uninitialized*) /Users/dimitrioskytros/Local Sites/wp/app/public/wp-content/themes/storefront/page.php:41
[07-Nov-2023 09:19:38 UTC] PHP   6. locate_template($template_names = [0 => 'footer.php'], $load = TRUE, $load_once = TRUE, $args = []) /Users/dimitrioskytros/Local Sites/wp/app/public/wp-includes/general-template.php:92
[07-Nov-2023 09:19:38 UTC] PHP   7. load_template($_template_file = '/Users/dimitrioskytros/Local Sites/wp/app/public/wp-content/themes/storefront/footer.php', $load_once = TRUE, $args = []) /Users/dimitrioskytros/Local Sites/wp/app/public/wp-includes/template.php:720
[07-Nov-2023 09:19:38 UTC] PHP   8. require_once() /Users/dimitrioskytros/Local Sites/wp/app/public/wp-includes/template.php:785
[07-Nov-2023 09:19:38 UTC] PHP   9. wp_footer() /Users/dimitrioskytros/Local Sites/wp/app/public/wp-content/themes/storefront/footer.php:37
[07-Nov-2023 09:19:38 UTC] PHP  10. do_action($hook_name = 'wp_footer') /Users/dimitrioskytros/Local Sites/wp/app/public/wp-includes/general-template.php:3069
[07-Nov-2023 09:19:38 UTC] PHP  11. WP_Hook->do_action($args = [0 => '']) /Users/dimitrioskytros/Local Sites/wp/app/public/wp-includes/plugin.php:517
[07-Nov-2023 09:19:38 UTC] PHP  12. WP_Hook->apply_filters($value = '', $args = [0 => '']) /Users/dimitrioskytros/Local Sites/wp/app/public/wp-includes/class-wp-hook.php:334
[07-Nov-2023 09:19:38 UTC] PHP  13. wp_print_footer_scripts('') /Users/dimitrioskytros/Local Sites/wp/app/public/wp-includes/class-wp-hook.php:310
[07-Nov-2023 09:19:38 UTC] PHP  14. do_action($hook_name = 'wp_print_footer_scripts') /Users/dimitrioskytros/Local Sites/wp/app/public/wp-includes/script-loader.php:2208
[07-Nov-2023 09:19:38 UTC] PHP  15. WP_Hook->do_action($args = [0 => '']) /Users/dimitrioskytros/Local Sites/wp/app/public/wp-includes/plugin.php:517
[07-Nov-2023 09:19:38 UTC] PHP  16. WP_Hook->apply_filters($value = '', $args = [0 => '']) /Users/dimitrioskytros/Local Sites/wp/app/public/wp-includes/class-wp-hook.php:334
[07-Nov-2023 09:19:38 UTC] PHP  17. Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->enqueue_asset_data('') /Users/dimitrioskytros/Local Sites/wp/app/public/wp-includes/class-wp-hook.php:310
[07-Nov-2023 09:19:38 UTC] PHP  18. Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->execute_lazy_data() /Users/dimitrioskytros/Local Sites/wp/app/public/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Assets/AssetDataRegistry.php:392
[07-Nov-2023 09:19:38 UTC] PHP  19. Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->Automattic\WooCommerce\Blocks\Assets\{closure:/Users/dimitrioskytros/Local Sites/wp/app/public/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Assets/AssetDataRegistry.php:343-349}() /Users/dimitrioskytros/Local Sites/wp/app/public/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Assets/AssetDataRegistry.php:267
[07-Nov-2023 09:19:38 UTC] PHP  20. Automattic\WooCommerce\Blocks\Domain\Services\Hydration->get_rest_api_response_data($path = '/wc/store/v1/checkout') /Users/dimitrioskytros/Local Sites/wp/app/public/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Assets/AssetDataRegistry.php:347

To reproduce

Steps to reproduce the behavior:

  1. Use the Cart/Checkout block, but use the legacy order confirmation template.
  2. Create a Simple Product.
  3. Purchase it.
  4. Open your logs in the order confirmation page.

Expected behavior

The user should be able to complete the purchase without seeing any notices.

Environment

WordPress (please complete the following information):

  • WordPress version: 6.3
  • WooCommerce version: 8.2.1.
@jimjasson jimjasson added the type: bug The issue/PR concerns a confirmed bug. label Nov 7, 2023
@opr opr added the block: checkout Issues related to the checkout block. label Nov 7, 2023
@mikejolley
Copy link
Member

This was fixed in #11128

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: checkout Issues related to the checkout block. type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
Development

No branches or pull requests

3 participants