Forum Replies Created

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

    (@didacroyo)

    He probado de desactivar algunos plugins que podrían causar el conflico (sin éxito). Finalmente he tocado un poco en el código fuente y he aplicado este parche… que parece que funciona.. es un parche muy feo o tiene un pase? muchas gracias

    original:

                   } else {
                            $order = new WC_Order( $order_id );
                            if ( 'yes' === $this->testmode ) :
                                    $redsys_adr = $this->testurl . '?';
                                    else :
                                            $redsys_adr = $this->liveurl . '?';
                                    endif;
                                    $redsys_args = $this->get_redsys_args( $order );
                                    $form_inputs = array();
                                    foreach ( $redsys_args as $key => $value ) {
                                            $form_inputs[] .= '<input type="hidden" name="' . $key . '" value="' . esc_attr( $value ) . '" />';
                                    }
                                    wc_enqueue_js(
                                            '
                                    $("body").block({
                                            message: "<img src=\"' . esc_url( apply_filters( 'woocommerce_ajax_loader_url', $woocommerce->plugin_url() . '/assets/images/select2-spinner.gif' ) ) . '\" alt=\"Redirecting&hellip;\" style=\"float>
                                            overlayCSS:
                                            {
                                                    background: "#fff",
                                                    opacity: 0.6
                                            },
                                            css: {
                                                    padding:                20,
                                                    textAlign:              "center",
                                                    color:                  "#555",
                                                    border:                 "3px solid #aaa",
                                                    backgroundColor:"#fff",
                                                    cursor:                 "wait",
                                                    lineHeight:             "32px"
                                            }
                                    })
                            jQuery("#submit_redsys_payment_form").click();
                            '
                                    );
                            return '<form action="' . esc_url( $redsys_adr ) . '" method="post" id="redsys_payment_form" target="_top">
                                    ' . implode( '', $form_inputs ) . '
                                    <input type="submit" class="button" id="submit_redsys_payment_form" value="' . __( 'Pay with Credit Card via Servired/RedSys', 'woo-redsys-gateway-light' ) . '" /> <a class="button cancel" href="' . esc_ur>
                            </form>

    añadido (en la parte final):

                            return '<form action="' . esc_url( $redsys_adr ) . '" method="post" id="redsys_payment_form" target="_top">
                                    ' . implode( '', $form_inputs ) . '
                                    <input type="submit" class="button" id="submit_redsys_payment_form" value="' . __( 'Pay with Credit Card via Servired/RedSys', 'woo-redsys-gateway-light' ) . '" /> <a class="button cancel" href="' . esc_ur>
                            </form>
    <script>
      $(document).ready(function() {
        // Obtiene la URL actual
        var currentUrl = window.location.href;
    
        // Crea una expresión regular para verificar si la URL contiene el patrón "finalizar-compra/order-pay/"
        var pattern = /finalizar-compra\/order-pay\//;
    
        // Verifica si la URL actual coincide con el patrón
        if (pattern.test(currentUrl)) {
          // Si coincide, ejecuta el código aquí
            jQuery("#submit_redsys_payment_form").click();
        }
      });
    </script>
    ';
    Thread Starter didacroyo

    (@didacroyo)

    Muchas gracias por la rápida respuesta. El sitio web es https://gloriabarcelona.com a ver si puedes ver lo que está pasando..
    Gracias

Viewing 2 replies - 1 through 2 (of 2 total)