A+ How to redirect to another page when appointment creation is successful

Hi
Can you tell me how to redirect a user to another page once appointment creation is successful?

Thanks
Vandana

  • Vinod Dalvi
    • WP Unicorn

    Hi Vandana,

    I hope you are well today and thank you for your question.

    You can achieve this by adding the following code in the functions.php file of your child theme.

    function app_redirect ($script) {
    	$page_id = 1312;
    	$url = !empty($page_id)
    		? "'" . get_permalink($page_id) . "'"
    		: 'app_location()'
    	;
    	return str_replace("window.location.href=app_location()", "window.location.href={$url}", $script);
    }
    add_filter('app_footer_scripts', 'app_redirect');

    This code assumes that you have a page or post on your side with ID 1312, so you may want to adapt it to fit your site's structure better by changing the page id in the above code to appropriate page ID.

    Please advise if you have more questions.

    Best Regards,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.