woocommerce / woocommerce-gateway-paypal-express-checkout

58 stars 65 forks source link

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

Open ilearnio opened 2 years ago

ilearnio commented 2 years ago

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 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

Changelog entry

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

Closes #883 .