This PR prevents a fatal error that might occur when trying to pay using PayPal Checkout for an order containing line items that are not WC_Product instances or that don't have the get_sku() method available.
The only difference from #856, is that this PR doesn't make any assumptions of what the SKU could or should be.
Steps to test:
Create a product.
Create an order (on the backend) containing said product.
Copy the "Customer payment page" link.
Delete the product created in step 1 and empty the trash.
Use the link from step 2 to pay for the order using PayPal Checkout.
On trunk, you'll see a fatal error:
Uncaught Error: Call to a member function get_sku() on bool in /wp-content/plugins/woocommerce-gateway-paypal-express-checkout/includes/class-wc-gateway-ppec-client.php:842
On this branch (issue/826) the order is processed correctly.
Changelog entry
Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.
Prevent fatal error when paying for an order containing products that are not in the catalog.
Issue: #826
Description
This PR prevents a fatal error that might occur when trying to pay using PayPal Checkout for an order containing line items that are not
WC_Product
instances or that don't have theget_sku()
method available.The only difference from #856, is that this PR doesn't make any assumptions of what the SKU could or should be.
Steps to test:
trunk
, you'll see a fatal error:issue/826
) the order is processed correctly.Changelog entry
Closes #826.