Hoe maak ik een custom Thank You pagina aan? - Funnelbox

Hoe maak ik een custom Thank You pagina aan?

Bekijk de video hier:

Custom Code voor de Snippet:

add_action( ‘template_redirect’, ‘woo_custom_redirect_after_purchase’ );

function woo_custom_redirect_after_purchase() {
/* do nothing if we are not on the appropriate page */
if( !is_wc_endpoint_url( ‘order-received’ ) || empty( $_GET[‘key’] ) ) {
return;
}

$order_id = wc_get_order_id_by_order_key( $_GET['key'] );
$order = wc_get_order( $order_id );
foreach( $order->get_items() as $item ) {
$product_id = $item->get_product_id();

if( $product_id == ) { wp_redirect( '' );
exit;
}

if( $product_id == ) { wp_redirect( '' );
exit;
}

}
}

>