You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have confirmed this occurs in the most recent version of WordPress, WooCommerce, and Facebook for WooCommerce.
I have confirmed this occurs when only WooCommerce and Facebook for WooCommerce are active and when using a default WordPress or WooCommerce theme.
✍️ Describe the bug
There's a JS error in the search page fbq is undefined. After tracking down the code i noticed that inject_search_event checkes for self::isEnabled which by default is true and overridable through a hook in apply_filtersmethod .
Hi @hogash - thanks for reporting this issue. Can you provide more details please so we can track down the issue? Thank you 😃
Exact steps to reproduce the issue - how is your Woo site set up, what page do you see the error on, do you need to click any buttons/links or type in any fields to see the error? Feel free to include screenshots.
How does this issue affect your store/business. Is this breaking your site or limiting what you can do? If you add these details it helps us prioritise.
🔎 Isolate the bug
✍️ Describe the bug
There's a JS error in the search page
fbq is undefined
. After tracking down the code i noticed thatinject_search_event
checkes forself::isEnabled
which by default is true and overridable through a hook inapply_filters
method .This method is hooked to
wp_head
( https://github.com/facebookincubator/facebook-for-woocommerce/blob/master/facebook-commerce-events-tracker.php#L30 ) which is fired later thanpre_get_posts
(the function where search runs https://github.com/facebookincubator/facebook-for-woocommerce/blob/master/facebook-commerce-events-tracker.php#L50 ), therefore it will always return the default true.My suggestion is to replace
wp_head
withinit
.The text was updated successfully, but these errors were encountered: