Submit Listing redirect

This topic contains 3 replies, has 3 voices, and was last updated by  Mitch Canton 5 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #509535

    Mitch Canton
    Expired Member
    Post count: 167

    Hello,

    After a new listing is submitted, the page simply refreshes to include the Preview link message. I’d like to actually redirect that process to another page.

    How would I make it so that once the Submit Listing button has been clicked, I could then automatically redirect that user to a specific page?

    Thanks.

    #509581

    Guust
    Moderator
    Post count: 29970

    I’ll get the developers to have a look at your question after the weekend. I am not sure that there is a simple way to do that.
    Thanks

    #509673

    Kiran
    Moderator
    Post count: 7069

    Hi Mitch,

    Try following PHP snippet.

    
    
    /**
     * Redirect to specific url after add listing form submitted.
     */
    function gd_snippet_ajax_save_post_message( $message, $post_data ) {
    	$redirect_to = 'https://www.google.co.in'; // Redirect url
    
    	ob_start();
    	?>
    	<script type="text/javascript">window.location = '<?php echo $redirect_to; ?>';</script>
    	<?php 
    	$redirect_to_js = ob_get_clean();
    
    	$message .= trim( $redirect_to_js );
    
    	return $message;
    }
    add_filter( 'geodir_ajax_save_post_message', 'gd_snippet_ajax_save_post_message', 100, 2 );

    Regards,
    Kiran

    #510089

    Mitch Canton
    Expired Member
    Post count: 167

    Thank you Kiran, I will give that a try. You are always very helpful with code tweaks, it’s very appreciated.

    Have a great day.

Viewing 4 posts - 1 through 4 (of 4 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount