Prestashop: Link::getProductLink() support for currency

Created on 16 Dec 2020  路  7Comments  路  Source: PrestaShop/PrestaShop

Is your feature request related to a problem?

I'm trying to generate feeds for Google Merchant and we are currently running one shop with two languages and three currencies. Therefor we need to generate different feeds for combinations of languages and currencies. Right now we can use the $id_lang with getProductLink to get the correct language for feed url's. But it does not look like $id_currency is supported.

Describe the solution you'd like

The ability to include $id_currency as a parameter for getProductLink

Or the ability to include $iso_code like EUR, USD et al.

Alternatives you've considered

I'm open for any suggestions

CO Currencies Improvement Products

All 7 comments

Hey @0dp

You can add something like:
&SubmitCurrency=1&id_currency=' . $this->currency->id;

at the end of your URL, but you're right that it might be a quite handy to have it in getProductLink, however this method has a lot of arguments already so I suggest to use my solution from above or $extraParams

Hi @0dp & @kpodemski ,

Thanks for the suggestion.
Please stay tuned as I ping the dev team !

Ping @PrestaShop/prestashop-core-developers ,

Do you think $id_currency could be added to the parameters of Link::getProductLink() ?

Thanks!

@kpodemski I think this is what I will do for now, thanks for the proposal.

@florine2623 looking forward for reply from dev team

Hi @0dp,
@kpodemski is right, it's the best way to specify a currency :+1:

I agree and it does work as expected.

Though it seems imo only natural that it belongs as a parameter in getProductLink() together with id_lang

We can close this issue since we have nothing to change in the Core right now. Feel free to reopen or create a new issue if you think an improvement must be done :)

Was this page helpful?
0 / 5 - 0 ratings