Skip to content

Fix fatal error when no product id passed to wc_get_product #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

ilearnio
Copy link
Owner

@ilearnio ilearnio commented Sep 1, 2021

Issue: woocommerce#883

Ticket:

Slack thread:


Description

Fixes fatal error that happens when navigating to a post of type "page" that has a shortcode [product_page id="ID"]. The error was happening because product ID was not detected for such a page and thus wc_get_product (that was called with no args) couldn't detect the product automatically, which caused error in intenal WC code.

Steps to test:

  1. Add a product to home page with a shortcode [product_page id="ID"]
  2. Navigate to home page

Documentation

  • This PR needs documentation (has the "Documentation" label).

Changelog entry

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

Closes woocommerce#883 .

@ilearnio ilearnio self-assigned this Sep 1, 2021
@ilearnio ilearnio marked this pull request as draft September 1, 2021 13:46
@ilearnio ilearnio closed this Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fatal error on home page after installing the plugin
1 participant