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
When Redirect to the cart page after successful addition is enabled in WooCommerce > Settings > Products, the ViewContent events aren't triggered across the site.
According to the explanation by @message-dimke - p1707212005472779/1706873190.731819-slack-CK365S85V:
No events are lost. This is just a behavior that confuses our users. We look at the WC setting for woocommerce_cart_redirect_after_add and decide whether to fire the event immediately or keep it and fire the next page render. This was made not to lose events because of the redirect and to render them the next page load (events get stored into a buffer and output on the next page). I can see this as confusing since not all events have to be delayed. We can add a filter not to delay all the events but only the affected ones.
If the user opens a product page and WC settings have woocommerce_cart_redirect_after_add set to on , we do not shoot ViewContent event but store it into a buffer. We do this because we render events at each page footer. In case of a redirect, the page footer won't be rendered, and events get lost. So, the user opens the page and the event goes into a buffer. The user adds the product, and the buffer gets rendered at the cart page (ViewContent for the product will fire at the cart page). If the user refreshes the product page, ViewContent will fire at the product page, and since we are still at that page, the new ViewContent will go into the buffer.
Adding a filter on events, which require the delay, will help here to render ViewContent when the product page loads and deffer other events which may get lost in case of the redirect setting.
While the expectation is that no events are lost, there's a report of this leading to loss of events. Opening this issue so we can double-check the ViewContent event handling, particularly as the event is triggered on v3.0.33 when Redirect to the cart page after successful addition is enabled.
✍️ Describe the bug
When
Redirect to the cart page after successful addition
is enabled inWooCommerce > Settings > Products
, theViewContent
events aren't triggered across the site.According to the explanation by @message-dimke - p1707212005472779/1706873190.731819-slack-CK365S85V:
While the expectation is that no events are lost, there's a report of this leading to loss of events. Opening this issue so we can double-check the ViewContent event handling, particularly as the event is triggered on v3.0.33 when
Redirect to the cart page after successful addition
is enabled.The text was updated successfully, but these errors were encountered: