Jump to content

get store country using $this->context


Zohaib-fk
 Share

Recommended Posts

  • 2 weeks later...
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 link

http://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;

 

Share this post


Link to post
Share on other sites

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();


 

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
 Share

×
×
  • Create New...

Important Information

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