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:
Add a product to home page with a shortcode [product_page id="ID"]
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.
Issue: #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 thuswc_get_product
(that was called with no args) couldn't detect the product automatically, which caused error in intenal WC code.Steps to test:
Documentation
Changelog entry
Closes #883 .