• Resolved fandresn

    (@fandresn)


    Saludos, espero que alguien me puede ayudar. Estoy intentando abrir una url externa (whatsapp) despues de finalizar la compra en la página de checkout. El código funciona, pero la idea es que se redireccione a la página de thankyou y despues en una ventana nueva se redirecione a la url del whatsapp.

    Este es el código que tengo por ahora:

    add_action( ‘woocommerce_thankyou’, function () {
    $sms = “Hola%20”;
    $urls = ‘https://api.whatsapp.com/send?phone=57300000000&text=’ .$sms ;
    $urln = ‘https://api.whatsapp.com/send?phone=57311111111&text=’ .$sms ;
    if ( ! $order->has_status( ‘failed’ ) ) {
    if ($order_billing_state == “S-SUR”) {
    wp_redirect( $urls );
    exit;
    } else {
    wp_redirect( $urln );
    exit;
    }

    }
    }

    Les agradezco mucho si me pueden ayudar…

Viewing 1 replies (of 1 total)
  • Saif

    (@babylon1999)

    Hello @fandresn,

    Thank you for reaching out!

    Saludos, espero que alguien me puede ayudar. Estoy intentando abrir una url externa (whatsapp) despues de finalizar la compra en la página de checkout. El código funciona, pero la idea es que se redireccione a la página de thankyou y despues en una ventana nueva se redirecione a la url del whatsapp.

    If I understand you correctly, you want to redirect a user after they’ve ordered something to an external page, not on your site.

    All the plugin solutions and code snippets will allow you to redirect to a page on your site.

    The only workaround I can think of is to embed the WhatsApp page in a WordPress page with an iframe using the Custom HTML Block.

    If that doesn’t work for you, then please consult with a WooExpert to figure out a custom solution.

    Hope this helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Redirección externa woocommerce_thankyou’ is closed to new replies.