Jump to content

url and currency


Recommended Posts

hi guys I need help, what happens is the following:

  • Our store sells in US dollars and euros, we have it like this because we are connected to google shopping and according to the documentation we can only campaign in the United States if our store works with dollars
  • When doing the google ads campaign for the United States, the documentation says that we have to remove the currency ( Noindex: / *? id_currency= ) from our robots.txt, so our campaign works fine
  • the problem is prestashop and its url that first when you activate this is not friendly at all. example 
  • and second and more serious is that the return link is lost for example in the source code of the page below, it is stated this is the Spanish version of the site
  • "https://janabebe.com/es/?SubmitCurrency=1&id_currency=1" hreflang="es">: 
  • https://janabebe.com/es/?SubmitCurrency=1&id_currency=1

    You also can see a link, that the English version of a website is located there: 

    https://janabebe.com/en/?SubmitCurrency=1&id_currency=1

    If we open the English version of a page and check the source code again, we'll see that the link to the Spanish version of a page this time leads to a different page than the first one: 

    https://janabebe.com/es/?SubmitCurrency=1&amp%3Bid_currency=1

    In the end we're having the discrepancy between 2 URLs: https://janabebe.com/es/?SubmitCurrency=1&id_currency=1 and https://janabebe.com/es/?SubmitCurrency=1&amp%3Bid_currency=1

    Such an issue can happen due to poorly written parameters or errors in the source code. And this is why WebSite Auditor shows that you don't have a return link on this page.
  •  
  • Is there any solution for this? How should it work with two currencies and that the url works well?

 

 

Share this post


Link to post
Share on other sites

Hello,

Your shop seems to use a module for "pretty url" without id in product page.
Do you know which module it is ?  Or did you modify the source code of Prestashop ?
It could change several things...

 

 

Share this post


Link to post
Share on other sites

Ok, i think we'll need to get into code to find solutions.
There could be bugs in your theme or/and your  langage/currency selector module AND we need to know what your "removing ids module" is really doing.

You can send me a private message, I could check what is going wrong.

Share this post


Link to post
Share on other sites

This is not "a problem", the SubmitCurrency parameter is send to ps_currencyselector to set the currency of the cookie.
This is the native way of Prestashop.

Without it, Prestashop is getting the currency from the cookie.
No way to set it via "special" friendly url like "/fr/eur" of "/us/usd". Is it what are you searching for ?

Anyway, links in your screenshots are generated by head.tpl of themes which use getAlternativeLangsUrl() from FrontController (and Link classes getLanguageLink).
If your module override url link generation (it does), it can be tricky to change that.

An easy and not very good option could be to set manually theses link in head.tpl but you can't add something in the url to set the currency except SubmitCurrency.
 

Share this post


Link to post
Share on other sites

The url can stay like this, I already imagined that it could not be made friendly, the problem is that 2 different urls are being generated for the same currency, this should not be like that, or what is the sense of doing this? in the screenshots I send you can see clearly

Share this post


Link to post
Share on other sites

Two urls for the same currency, not really because %3B is a semicolon, it's just & where (i don't known why), the semicolon is encoded.

This %3B doesn't show up in my browser (Firefox / Chrome) in the source of the page

But, I saw weird bug in your shop :

Url parameters are added twice. (click on EUR, click on USD, click on EUR). (probably an other problem...)

Like i said, the easy way is to edit head.tpl template and set urls or/and with a custom module.
A good thing would be also to switch currency without changing url by using AJAX request (improve currency selector module).

janabebe-2020-09-10_13-47.png

Share this post


Link to post
Share on other sites
6 minutes ago, juanrojas said:

Exactly, I think that would be the solution, that the url does not change, when the user changes the currency

But urls 'alternate' in HEAD will still have currency parameter. I don't think it's useful, don't you ?
When Google go to this page, the default currency will be selected, so what is the point of overriding it there ?

Share this post


Link to post
Share on other sites

Ok. Please tell me if it helps or not.
The best thing to do should be to define precisely what behaviour you want to have and create a custom module or/and edit the theme to do that.
To add a module and add another, and another is rarely a good thing.
One module to do only one custom thing else you'll end up with 300 modules...

Share this post


Link to post
Share on other sites

they tell me

"Those URLs are generated by the currency selector. What our module does is adapt the currency to the customer's location. For example, a customer from the USA will see the store in dollars directly, a customer from Europe in euros, and so on with the currencies installed in the store. When the module sets the currency, it does not generate those URLs, but if once established the client uses the currency selector to change it (although in theory it shouldn't because it would already be "its" currency), it will generate those URLs."

Share this post


Link to post
Share on other sites
11 minutes ago, juanrojas said:

And from what I am reviewing, this did not happen in prestashop 1.6, how many more years for prestashop 1.7 to be ready? it's quite an enigma

Maybe it was fixed and with a new version the issue came back.

Share this post


Link to post
Share on other sites
6 minutes ago, juanrojas said:

The solution is logical, deactivate the ads campaign for the United States and deactivate the currencies. We have a lot of SEO work and clearly this affects a lot.

It could be fixed, but with custom dev / adapt currency selector module.

Share this post


Link to post
Share on other sites
1 hour ago, juanrojas said:

I have my doubts this has been reported 2 years ago and it seems that they have planned for 1.7.7

For the issue with doublon in url it's very easy to fix, just copy and replace ps_currencyselector.php in the module directory with the one in github : https://raw.githubusercontent.com/jolelievre/ps_currencyselector/1b2422a1ec3e1708778695436d63e89917bbc9e2/ps_currencyselector.php

Planned for 1.7.7 but you can already fix it if you want. I tested in a test shop it's working.

 

Edited by _tech (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More