Jump to content

url and currency


juanrojas

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?

 

 

Link to comment
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.

Link to comment
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.
 

Link to comment
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

Link to comment
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

Link to comment
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 ?

Link to comment
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...

Link to comment
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."

Link to comment
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.

Link to comment
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)
Link to comment
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...