Hey Anne,
By RC do you mean release candidate?
I’m not sure what I’d be able to do without more information here, I’m not doing anything I know of to the session, but I’ll check the code.
Cheers,
Sean
Hi Anne, Sean,
I have actually got the same issue with WooCommerce 2.1.
The problem was in /plugins/wp-content/striper/stripe_gateway.php file.
Line: 188.
WooCommerce 2.1. doesn’t have ‘woocommerce_thanks_page_id’ option anymore. I have added my own page number instead and it works now. But I still need to find the new WooCommerce 2.1. thank you page π
The problem was because get_permalink was returing /wp-admin/ajax.php as a URL.
Kind regards
Replace below code located in /plugins/stripes/strip-gateway.php#177:
if ($this->send_to_stripe())
{
$this->completeOrder();
return array(
'result' => 'success',
'redirect' => add_query_arg(
'order',
$this->order->id,
add_query_arg(
'key',
$this->order->order_key,
get_permalink(get_option('woocommerce_thanks_page_id'))
)
)
);
}
to [1]
if ($this->send_to_stripe())
{
$this->completeOrder();
wp_redirect($this->get_return_url($this->order));
exit;
}
[1] http://develop.woothemes.com/woocommerce/2013/11/woocommerce-2-1-beta-1-is-ready/ (Getting page permalinks (e.g. in gateways))
Actually it should be replaced by below:
if ($this->send_to_stripe())
{
$this->completeOrder();
$result = array(
'result' => 'success',
'redirect' => $this->get_return_url($this->order)
);
return $result;
}
Now it works!
Thread Starter
dirkse
(@dirkse)
thanks so much! I too had found someone having the same error with other payment types where the page was missing and notice that it was newly changed, but I had *no* idea how to fix it.
You’re welcome, dirkse!
The newest 0.27 version of the plugin hasn’t got above fix applied so the operation needs to be repeated.
Sorry about that wolnik, I’ll get it in the next version here, I need to see if the get_return_url works with the current version of wp, or if i need to make an if statement.
Thanks so much for your work on this!
Wolnik,
Check out 0.28 I’ve added your code, does it work for you out of the box?
Sean, thanks! It does work out of the box now.
Great plugin!
I am getting this same error after checkout, but with Authorize.net. Does that mean the issue is in the Authorize.net plugin? Thanks for any response.
The problem is with below deprecated option in WooCommerce version 2.1:
get_permalink(get_option('woocommerce_thanks_page_id'))
Above needs to be replaced with the following, where $this is an instance of WC_Order class:
$this->get_return_url($this->order)
Excellent, Here is the snippet of code to be altered, yes?
public function get_checkout_order_received_url() {
$order_received_url = wc_get_endpoint_url( ‘order-received’, $this->id, get_permalink( wc_get_page_id( ‘checkout’ ) ) );
$this->get_return_url($this->order)
if ( ‘yes’ == get_option( ‘woocommerce_force_ssl_checkout’ ) || is_ssl() ) {
$order_received_url = str_replace( ‘http:’, ‘https:’, $order_received_url );
}
$order_received_url = add_query_arg( ‘key’, $this->order_key, $order_received_url );
return apply_filters( ‘woocommerce_get_checkout_order_received_url’, $order_received_url, $this );
}
Sorry I posted too soon, without the ability to edit..
$this->get_return_url($this->order)
replaces
$this->id, get_permalink( wc_get_page_id( ‘checkout’ )
Does that appear correct?
Thanks for the help Wolnik!
Hi. I’m having the same problem as the above β using the Authorize.net gateway. I see that others have fixed the problem by replacing snippets of code. My question is… can you tell me which specific file in Woocommerce 2.1.2 I can find the code? Thank you all so much!