PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Urgent: Payment Link Redirection Issue for Logged-In Repeat Customers

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hello Team,

We’re experiencing an issue where the payment link in our emails is not redirecting correctly when your plugin is enabled.

Issue Details:

What We've Checked:

  • The correct payment links are being sent via email.
  • The issue only occurs when the plugin is active, and the user is clicking on the email link.
  • It seems that the required parameters ?pay_for_order=true&key=wc_order_zob6Q70cHaLLE are getting removed or altered during redirection.
  • No GET data in link toggle is on in the Woocommerce Settings > Currency > Options
  • Tested with Currency storage > Transient and FOX Session both and facing same issue
  • Current Setting: https://ibb.co/sdtBs8dc

Could you please help me to investigate this issue? Let us know if there's a possible fix or adjustment to the setting to ensure the correct redirection so it won't add ?currency=ENC::QVVE.

Looking forward to your response.

Best regards,

Prince

Hello Prince

Can you drop  me wp-admin access - https://share.pluginus.net/image/i20230222134241.png ->https://share.pluginus.net/image/i20230222134615.png

Hello @pavlo_borysenco

Access has been added.

Hello

It seems that the problem is related to third-party booking functionality

We have done testing on several of our sites with standard orders - there is no such error. And our plugin does not contain code to change links in the email

Do you have a test site?

Hello,

I currently don't have access to the test site. However, do you know how it's adding ?currency=ENC::QVVE to the URL? This way, we can find a solution to prevent it from happening! We're only using this plugin for currency conversion.

I am thinking to add below code into functions.php what's your thought on it?

function remove_currency_from_checkout_url($url) {
if (strpos($url, 'checkout/booking-pay') !== false) {
// Parse URL to separate query parameters
$parsed_url = parse_url($url);
if (!isset($parsed_url['query'])) {
return $url; // If no query string, return original URL
}

// Convert query string into an array
parse_str($parsed_url['query'], $query_params);

// Remove the currency parameter if it exists
unset($query_params['currency']);

// Rebuild the query string without the currency parameter
$new_query = http_build_query($query_params);

// Construct the final URL
$clean_url = $parsed_url['scheme'] . '://' . $parsed_url['host'] . $parsed_url['path'];
if (!empty($new_query)) {
$clean_url .= '?' . $new_query;
}

return $clean_url;
}
return $url;
}
add_filter('woocommerce_get_checkout_payment_url', 'remove_currency_from_checkout_url', 20, 1);

OR

function remove_currency_from_payment_redirect() {
if (is_checkout() && isset($_GET['currency'])) {
wp_redirect(remove_query_arg('currency'));
exit;
}
}
add_action('template_redirect', 'remove_currency_from_payment_redirect');

- Keeps all original parameters (e.g., pay_for_order=true&key=wc_order_xyz)
- Only removes currency=ENC::QVVE
- Ensures proper redirection without breaking WooCommerce payment flow

Hello

However, do you know how it's adding ?currency=ENC::QVVE to the URL?  - https://share.pluginus.net/image/i20250212102423.png

In order to fix this, you should find the source of this behavior. As I wrote above, my plugin does not have such functionality, so for the test, disable third-party plugins

Unfortunately I'm not sure this code will help.

Hello @pavlo_borysenco,

Thank you for investigating this; it originated from the custom code. Mark this as issue resolved.

Great! Welcome;)