-
Notifications
You must be signed in to change notification settings - Fork 219
Single Product Block Causing Fatal Error on Product Pages For Logged Out Users When Jetpack woocommerce-analytics Module is Active #9453
Single Product Block Causing Fatal Error on Product Pages For Logged Out Users When Jetpack woocommerce-analytics Module is Active #9453
Comments
I know hot to solve this, so I would like to do it. But I don't know how to :p |
cc @danielwrobert and @tjcafferkey - this should be prioritized by the team when folks come online next. The code shouldn't be overwriting the global here. It'd be good to review other blocks and ensure there are no other incorrect global overwrites. |
Yah there are other places too:
|
Regarding the Single Product block currently we have to overwrite the
As soon as these changes are merged in the core of WP we can get rid of that piece of code, because we can rely on the |
Hi there! The Add to Cart Form block and the Product Gallery Block fixes are available over here (with a topic open for discussion):
Regarding the Single Product block, complementing @thealexandrelara 's response: As he mentioned, we have already upstreamed changes to the core of Gutenberg to prevent the global variable overwrite; the only problem is that those are not yet part of the core of WordPress (WP is currently running GB version 15.1: the fix for the post title comes with GB 15.2 & the fix for the excerpt is on GB version 15.6), so we've decided to keep the "hacky" approach in place until they do. It is also important to mention that this block (the Single Product block) is experimental, available only on dev builds as it is still not ready for usage by the general public. |
@nefeline Circling back to note that we're showing the option to convert to the blockified single product template in the site editor on WPcom Commerce sites (where I ran into this) with no warning or notice that this shouldn't be used on production sites. Is that expected? EDIT: Given the experimental status of this (and potentially all other components in the plugin?) would you suggest we avoid the blocks plugin completely on production Team51 sites? |
Hi Katie, it's no longer experimental :) |
Hi there @katiebethbrown !
As Darren already highlighted, this is not an experimental feature anymore :) The Single Product block became available for general usage on June 8th (release 10.4.0).
It is now available for usage on production sites: looking forward to hearing your thoughts/experience with it! |
@nefeline - Ah, I missed this. Thank you!
So far all good other than the analytics issues! We ran into something similar to this issue (a fatal for logged out users) when enabling the Google Analytics enhanced ecommerce option, but that was earlier and it seems likely that the fix for this issue also resolved that one. Thanks again! |
@katiebethbrown the GA issue came up in another project as well on WPcom (GG) and it is related to customized single product templates where there is no post content block in the template. GA makes an assumption about the |
Ah, that's really helpful info. Thank you @nerrad! |
Describe the bug
When using the Single Product Block, single product pages return a fatal error for logged out users when the Jetpack
woocommerce-analytics
module is active.To reproduce
Steps to reproduce the behavior:
Expected behavior
For the single product page to load for logged out users.
Error
Environment
WordPress (please complete the following information):
Additional context
We're running into this on a Team51 partner site. Per the dev:
woocommerce-blocks/src/BlockTypes/AddToCartForm.php
Lines 27 to 28 in cde9117
woocommerce-blocks/src/BlockTypes/AddToCartForm.php
Lines 45 to 56 in cde9117
Related issue in the JP repo:
Automattic/jetpack#11301 (comment)
The text was updated successfully, but these errors were encountered: