Zohaib-fk Posted November 16, 2017 Share Posted November 16, 2017 Hi, I want to get store country name which is set at the time of installation and back-office configuration. I tried below but no success. echo"<br>Store Country=>".$this->context->country; Below documentation linkhttp://doc.prestashop.com/display/PS15/Using+the+Context+Object Any Idea? Link to comment Share on other sites More sharing options...
bellini13 Posted November 16, 2017 Share Posted November 16, 2017 Is this for PS v1.5, v1.6 or v1.7? This code will you the Country object $this->context->country This code will get you the countrys name $this->context->country->name Link to comment Share on other sites More sharing options...
Zohaib-fk Posted November 28, 2017 Author Share Posted November 28, 2017 (edited) Hi, I am using prestashop 1.7. Thanks It will give default country name from back-office=>International=>localization PrestaShop Tutorials Videos [How to do Tasks] https://www.prestashop.com/forums/topic/907438-prestashop-tutorials-videos-how-to-do-tasks/ Edited July 1, 2021 by Zohaib-fk Post Updated (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted November 29, 2017 Share Posted November 29, 2017 21 hours ago, zohaib82 said: It will give default country name from back-office=>International=>localization Is that a question? Link to comment Share on other sites More sharing options...
Inform-All Posted November 29, 2017 Share Posted November 29, 2017 On 16/11/2017 at 11:28 AM, zohaib82 said: Hi, I want to get store country name which is set at the time of installation and back-office configuration. I tried below but no success. echo"<br>Store Country=>".$this->context->country; Below documentation linkhttp://doc.prestashop.com/display/PS15/Using+the+Context+Object Any Idea? Hi, Try this: global $cookie; $LanguageIso = Language::getIsoById( (int)$cookie->id_lang ); echo $LanguageIso; Link to comment Share on other sites More sharing options...
Zohaib-fk Posted November 30, 2017 Author Share Posted November 30, 2017 Hi bellini13 It is not a question, I mean it shows country from localization default country.This is to share information from where store default country will be shown in variable. Many thanks Inform-All for code. Do you have any idea about getting unique browser session id using cookies in prestashop. Below code helps to get unique session id using php default functions. session_id(); 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