coMegaWebMaster Posted February 27, 2018 Share Posted February 27, 2018 Greetings, Am trying to set in the country ID or ISO value within the link to pre-select the country. This is due that counties in EU have tax set in the price and out of EU the prices are without tax and if I send now an link to a customer they are not getting the price they should see. I already have the code to set the correct currency and that is working fine, but not for the country and I hope here someone can help. An example of what I want is:www.demoshop.demo/en/categorie/product.html?the_country=24 ORwww.demoshop.demo/en/categorie/product.html?the_country=AU that will result in pre-selecting Australia in this case, so also when you go to the checkout page that the country is already selected. What I have so far in /override/classes/Tools.php for this, but does not work yet: public static function setCountry($cookie) { if (self::getIsset('the_country') && is_numeric(self::getValue('the_country'))) { $country = Country::getCountryInstance((int)(Tools::getValue('the_country'))); if (is_object($country) && $country->id && !$country->deleted && $country->isAssociatedToShop()) { $cookie->id_country = (int)$country->id; } } With kind regards, Alexander. Link to comment Share on other sites More sharing options...
jsonPTS Posted February 28, 2018 Share Posted February 28, 2018 Hello PrestaShoper, See the attached image, this can give you a better idea of where you should make the modifications. File capture "/classes/controller/FrontController.php". Best regards. Link to comment Share on other sites More sharing options...
El Patron Posted February 28, 2018 Share Posted February 28, 2018 an option to consider https://addons.prestashop.com/en/international-localization/27368-geo-targeting-pro-by-country-prices-taxes-currency-.html?pab=1& basically then when they enter shop from their country, non-logged, they see their country catalog note: module supports two maxmin commerical db's and our clients are getting 99.75% resolve rate, the module has resolve insights. maybe no help for your current situation, but if you are international company....I am giant in geo lol happy selling Link to comment Share on other sites More sharing options...
coMegaWebMaster Posted February 28, 2018 Author Share Posted February 28, 2018 Hi El Patron, I had a look at your module, but am afraid that this will not help me in this case. I really need to give a link that will pre-select the country no-matter where they are (or using a VPN), as what I already have with currencies now what is working. But I think am over-complicating or overthinking it and not seeing the obvious solution. Just want to add in the link ?the_country=24 or ?the_country=AU, like:www.demoshop.demo/en/categorie/product.html?the_currency=23?the_country=24ORwww.demoshop.demo/en/categorie/product.html?the_currency=AUD?the_country=AUthat will result in pre-selecting Australia in this case. Tomorrow I will re-look it with the information I got from jsonPTS and hopefully I can get it to work, but am open to suggestions With kind regards, Alexander. Link to comment Share on other sites More sharing options...
elijah88 Posted July 19, 2022 Share Posted July 19, 2022 Hi @coMegaWebMaster have you found a solution? IF yes, please share the code 🙏 Kind regards, Elijah Link to comment Share on other sites More sharing options...
coMegaWebMaster Posted July 21, 2022 Author Share Posted July 21, 2022 On 7/19/2022 at 7:34 PM, elijah88 said: Hi @coMegaWebMaster have you found a solution? IF yes, please share the code 🙏 Kind regards, Elijah Hi @elijah88, This is a very old topic, am using a few modules to solve my issue, what PrestaShop version are you using and do you want to work? With kind regards, Alexander. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now