Redirect Users To a Custom Thank You Page Upon Product Checkout in WooCommerce

Поділитися
Вставка
  • Опубліковано 15 жов 2024

КОМЕНТАРІ • 5

  • @victorchinedu
    @victorchinedu  8 місяців тому +3

    /**
    * Redirect WooCommerce to a custom page after checkout
    */
    add_action( 'woocommerce_thankyou', 'reialesa_redirect_woo_checkout');
    function reialesa_redirect_woo_checkout( $order_id ){
    $order = wc_get_order( $order_id );
    $url = 'Insert URL here';
    if ( ! $order->has_status( 'failed' ) ) {
    wp_safe_redirect( $url );
    exit;
    }
    }

  • @medialyon1583
    @medialyon1583 5 місяців тому

    It worked. Thank you!

    • @victorchinedu
      @victorchinedu  5 місяців тому

      I'm Glad to hear that. Thank You.

  • @vickyborse8049
    @vickyborse8049 4 місяці тому

    This code showing thank you name only not showing order detail and other please make code there show all detail for order

    • @victorchinedu
      @victorchinedu  4 місяці тому

      It's ideally supposed to redirect the user to the custom-built "Thank You Page of Your Theme"