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

Error on shop page : Expected WC_Product, got 'false' when generating ViewCategory event. #38

Closed
sanderkie opened this issue Sep 15, 2017 · 3 comments
Assignees

Comments

@sanderkie
Copy link

Hello,

it seems an error is caused on many shop pages. These were picked up by Google Webmaster Tool so this is not just a manually created link.

Example url:
website.com/Shop/page/12/?orderby=price
The error is as follows:
Fatal error: Uncaught Error: Call to a member function get_sku() on boolean in /mnt/env/website/production/public_html/wp-content/plugins/facebook-for-woocommerce/includes/fbutils.php:86 Stack trace: #0 /mnt/env/website/production/public_html/wp-content/plugins/facebook-for-woocommerce/facebook-commerce-events-tracker.php(49): WC_Facebookcommerce_Utils::get_fb_content_ids(false) #1 /mnt/env/website/production/public_html/wp-includes/class-wp-hook.php(298): WC_Facebookcommerce_EventsTracker->inject_view_category_event('') #2 /mnt/env/website/production/public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array) #3 /mnt/env/website/production/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #4 /mnt/env/website/production/public_html/wp-content/plugins/woocommerce/templates/archive-product.php(96): do_action('woocommerce_aft...') #5 /mnt/env/website/production/public_html/wp-includes/template-loader.php(74): include('/mnt/env/goedes...') #6 /mnt/env in /mnt/env/website/production/public_html/wp-content/plugins/facebook-for-woocommerce/includes/fbutils.php on line 86

Is this a known issue and is there a fix for this?

@dmitridr dmitridr added the bug label Sep 18, 2017
@dmitridr dmitridr self-assigned this Sep 18, 2017
@dmitridr
Copy link
Contributor

dmitridr commented Sep 18, 2017

This is a new issue, I'll look into adding a fix for the next version. Looks like it happens for ViewCategory pixel events, where one of the products is deleted? I haven't been able to get a repro yet.

@sanderkie
Copy link
Author

Thank you dmitridr, that is appreciated.
It might be that the product is deleted I cannot verify that as of now.

But it seems to be on multiple pages and Google Webmaster tools has encountered multiple of these errors.

@dmitridr
Copy link
Contributor

We weren't able to repro, but I added logic in v1.6.2 that should prevent an exception there in future versions. Thanks for reporting this!

@dmitridr dmitridr changed the title Error on shop page Error on shop page : Expected WC_Product, got 'false' when generating ViewCategory event. Sep 29, 2017
deivamagalhaes pushed a commit that referenced this issue May 21, 2020
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

No branches or pull requests

2 participants