Hi id like to redirect user to a different page after they purchased a paid listing which currently now defaults to the listing page. How do i do this?
Please let me know if this redirect should occur for paid listings only, or there are different flows for paid and free listings (if you allow free listings). If the flow is the same, you can simply customize the Listing Submitted page in HivePress/Templates section, there’s the same editor as for pages so it’s possible to add any content there How to customize templates - HivePress Help Center
P.S. I recommend switching to the Memberships extension for the paid listings functionality as Paid Listings will be eventually deprecated, recently we merged most of its features into Memberships.
I have tried but the user flow is not sales friendly. when a user click submit a listing it will automatically send users to the membership plan page. And they are forced to purchase a plan before being able to explore the site causing a low conversion rate). This has caused a drop in new listings and sales. Right now my plan is to have user submit a listing with paid listing (lower entry barrier due to lower price to purchase a single featured/basic listing instead of a whole package) which then in return have users committed to the site. After payment and listing submission they will be redirected to a landing page which shows the attributes and pages they can unlock if they decide to become a member. This way they will be able to make informed decisions. Another issue is if i have featured listing in a package for membership new users have no idea they have to feature their listing manually. So the default setup for membership is confusing and caused a high bounce rate for my case.
I have solved this on my own after sometime . Earlier on i did not realize hivepress has its own hardcoded redirection which made all redirection attempts failed. Im using this code to redirect users after purchase by first stopping default redirection from hivepress. Below is the code if anyone is looking for similar
// 1) Stop HivePress from forcing its own redirect
add_action( 'init', function() {
if ( function_exists( 'hivepress' ) && hivepress()->listing_package ) {
remove_action(
'template_redirect',
[ hivepress()->listing_package, 'redirect_order_page' ]
);
}
}, 0 );
// 2) After successful checkout, redirect by product ID
add_action( 'woocommerce_thankyou', function( $order_id ) {
if ( ! $order_id ) return;
$order = wc_get_order( $order_id );
if ( ! $order || $order->has_status( 'failed' ) ) return;
// Map product IDs to destinations
$redirect_map = [
5832 => 'https://yourdomain.com/',
// 1234 => 'https://some-other-page/',
// 5678 => 'https://another-page/',
];
// Check each line item
foreach ( $order->get_items() as $item ) {
$pid = (int) $item->get_product_id();
if ( isset( $redirect_map[ $pid ] ) ) {
wp_safe_redirect( $redirect_map[ $pid ] );
exit;
}
}
}, 10, 1 );
Thank you for the solution! This will be helpful for our community.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.