[Resolved] Redirect to created post after purchase is completed CRED
This support ticket is created 7 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I need to know how you configured things and what exactly you would like to achieve. I can not able to provide solution without checking your site flow.
Can I have step by step information with your issue and to which product/page you want to redirect back?
I have a CRED commerce form that creates a new post. Post type Bookings.
I've chosen to charge for this form.
The product is specified in Cred commerce settings.
Redirect is set to checkout.
When payment is complete, the user is redirected to the Woocommerce order.
Instead, I would like them to be redirected to the post that was created with the CRED form.
Hello Minesh.
Nope that didn't redirect me to the post edited in CRED it took me to the Cart. hidden link
Thanks to you I was able to make it work with a small change
If anyone else needs the same:
// Redirected to CRED created/edited post after Woocommerce payment
add_action('cred_commerce_after_order_completed','func_my_custom_order_completed',10,1);
function func_my_custom_order_completed($data) {
$post_id = $data['extra_data'][0]['cred_post_id']; //Post ID that was created/edited with the form
$url = get_permalink( $post_id );
wp_redirect( $url );
exit;
}