Support Forum

Content of the article

WPBE - WordPress Posts Bulk Editor Professional
You need to log-in to create request (topic) to the support

Currency Switcher widget doesn't work if anchor (#) in page's URL

(new from 01-07-2019)
This support system is for all types of the plugins as for premium versions, so for free ones! If you have premium version do not forget in the private data of the request (!!not in the text of the support request!!) after its publishing insert purchase code please (see green button on the right side) and press Save button.
If you not got email within 24 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.

Good day. I have a website (see link in private) that has a homepage with onePage scroll plugin with sections, each section has an anchor (#p-1, #p-2, #p-3 etc). While scrolling through each section, an anchor is added to the URL of the page (url.com#p-1, url.com#p-2 etc) to keep href's in right-side menu workable.

But while the anchor link is added to the page's adress bar (during scrolling), and you select a currency in the widget, the request is not sent (but the request parameters are added to the address bar immediately after the anchor's parameters, like url.com/#p-4?currency=EUR, and it is duplicated when pressed repeatedly - url.com/#p-4?currency=EUR?currency=EUR). Disabling anchors will adversely affect site navigation, is there any other way to solve this problem?

I will gladly buy the full version of this useful plugin to support multiple currencies, but this problem greatly reduces its value for my site

Hello

in file - wp-content\plugins\currency-switcher\js\front.js  change  this  function  -

function wpcs_redirect(currency) {
if (!wpcs_sumbit_currency_changing) {
return;
}

//***
var l = window.location.href;

//for #id navigation l = l.replace(/(#.+$)/gi, '');
l = l.split("#");
var anch="";
if(typeof l[1]!='undefined'){
anch="#"+l[1];
}
l = l[0];

l = l.split('?');
l = l[0];

var string_of_get = '?';
wpcs_array_of_get.currency = currency;
/*
l = l.replace(/(\?currency=[a-zA-Z]+)/g, '?');
l = l.replace(/(&currency=[a-zA-Z]+)/g, '');
*/

if (Object.keys(wpcs_array_of_get).length > 0) {

string_of_get += decodeURIComponent(jQuery.param(wpcs_array_of_get));
}

window.location = l + string_of_get+anch;
}

AND  comment  these  lines - https://c2n.me/445rtqE.png

Do  test  please!

It worked! I appreciate you, and I hope this will be added in the next update

Hello

I hope this will be added in the next update - Yes!

Welcome;)