Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter stephenwayne

    (@stephenwayne)

    Here is how a different Woo thank you page plugin has advised adding the function to theirs:

    https://www.storeapps.org/docs/ctp-how-to-add-custom-parameter-in-custom-thank-you-page-url/

    add_filter( 'modify_ctp_url', 'my_custom_ctp_url' );
    function my_custom_ctp_url( $thankyou_page_url ) {
    	$part_url = parse_url( $thankyou_page_url );
    
    	if ( isset( $part_url ) && isset( $part_url['query'] ) ) {
    		$query_params = array();
    		parse_str( $part_url['query'], $query_params );
    
    		$order_id = absint( $query_params['ctp_order_id'] );
    		$order = wc_get_order( $order_id );
    
    		if ( $order instanceof WC_Order ) {
    			$thankyou_page_url = add_query_arg(
    						array(
    							'ctp_first_name' => $order->get_billing_first_name(),
    						), $thankyou_page_url
    					);
    		}
    
    	}
    
    	return $thankyou_page_url;
    }
    Plugin Support Alberto Martin

    (@albertomrtn)

    Hi @stephenwayne, unfortunately, this Free plugin does not have a filter to be able to do what you want.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Append URL with parameters – billing email, first name, etc’ is closed to new replies.