Hello again
I found that the problem occurs with the Elementor plugin, if I disable it, everything works fine, but since keeping it disabled is not an option I decided to look for an alternative..
After a long investigation, having all the plugins disabled except Elementor & Woocommerce, I discovered that the problem is caused by the function “wc_get_endpoint_url()” (wp-page-functions.php, line 88), of Woocommerce, not from MercadoPago extension. It was returning, for some reason, always the home URL, so the workaround I found was concatenating “/finalizar-compra” (my pay page, previously configured, as seen in the screenshot) in the “get_checkout_order_received_url()” filter (class-wc-order.php, line 1608).
So I was left like this:
from:
return apply_filters( 'woocommerce_get_checkout_order_received_url', $order_received_url, $this );
to:
return apply_filters( 'woocommerce_get_checkout_order_received_url', '/finalizar-compra'.$order_received_url, $this );
I tried the above with the default Woocommerce pages, to discard possible problems with Elementor.
This at least allows to redirect after a purchase, although I had to add the domain of my page to a function of MercadoPago extension in the same way so that the native redirections of Woocommerce + MP extension would work.
I hope you can help me to get a more definitive solution since otherwise I have to be modifying the plugin after each update.
Greetings.