Osclass Support Forums

General osclass questions => General discussion => Topic started by: Jack on April 22, 2020, 05:39:13 PM

Title: echo $current_country_code
Post by: Jack on April 22, 2020, 05:39:13 PM
Hi,

I tried in every way to print the country string in main page (eg: echo $current_country_code )

does anyone know how it can be done?

I tested:
echo osc_country();
echo $country['pk_c_code'];
$current_country_code = $country['pk_c_code'];

also $codecountry= str_replace('http://', '', osc_country_url());
 $codecountry = str_replace('.MYDomain', '', $codecountry); >>>>> no good
Title: Re: echo $current_country_code
Post by: MB Themes on April 22, 2020, 08:39:33 PM
Country of what?
Title: Re: echo $current_country_code
Post by: Jack on April 22, 2020, 10:01:29 PM
my site is www.domain.com (world)
fr.domain.com (france)
uk.domain.com (united kingdom)
...

I would like to know the "$ string" to be able to easily insert small variations for each country on the theme

thank you
Title: Re: echo $current_country_code
Post by: MB Themes on April 23, 2020, 07:19:58 AM
@Jack
Ah, I have never tried subdomains, not quite sure if you can get it in that way. Simplest might be to define city/country of subdomain in config.php
Title: Re: echo $current_country_code
Post by: Jack on April 23, 2020, 03:14:27 PM
the subdomains are configured correctly and everything works.

What I can't do is get the string "country name" or "$country['pk_c_code']" on the main.php page..