Skip to content
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

Fatal error while placing order #945

Closed
mechanicalgux opened this issue Nov 27, 2017 · 3 comments

Comments

@mechanicalgux
Copy link

commented Nov 27, 2017

if ($product->is_type('variation')) {

If $order->get_product_from_item($values); returns false, "Place order" will fail with an error 500.
The check is done above if (is_object($product)) but not at line 195.

The produced error is: Fatal error: Uncaught Error: Call to a member function is_type() on boolean

@iMansoorAliKhan

This comment has been minimized.

Copy link
Collaborator

commented Nov 27, 2017

@mechanicalgux Are you using the latest version of Our plugin? Can you confirm WC version, WP version and Payment gateway you are using?

@mechanicalgux

This comment has been minimized.

Copy link
Author

commented Nov 28, 2017

Yes latest version 1.4.6.7, WC 3.2.5, WP 4.9 with Paypal Express Checkout gateway.
Bug introduced with this commit: 2a207b5#diff-b529e81a0f84e28b21a8433d59d9638b

Sometimes the order doesn't contain an actual WC product (custom datastore), therefore $product is "false". Just make a check is_object($product) above and it should fix the problem.

@angelleye angelleye added the bug label Nov 28, 2017
@angelleye angelleye added this to the 1.4.7 milestone Nov 28, 2017
@angelleye

This comment has been minimized.

Copy link
Owner

commented Nov 28, 2017

@mechanicalgux Thanks for the info! We'll make necessary adjustments on the 1.4.7 update we're working on now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.