Redirect after checkout

Hi @ihor

I’m doing some testorders with my site and when i run through the checkout i get redirected to the listing. Is there a way to redirect to the default Woocommerce page https://www.sitename.com/checkout/order-received? Else i can’t get to the datalayers of the order to track sales in Google Tag Manager / Analytics.

Thank you,
Menno

Please try this PHP snippet

remove_action( 'template_redirect', [ hivepress()->listing_package, 'redirect_order_page' ] );

@yevhen thank you, but this crashes the site when i put it into functions.php

Please check this tutorial on how to add custom code snippets How to add custom code snippets - HivePress Help Center

I understand where to put the code but it looks like the code contains a bug.

Please provide more details about the bug. This snippet was tested locally and it seems to be ok Screenshot by Lightshot

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.