Jump to content

Using global php variable in PS 1.7


Recommended Posts

Hello there. I want to redirect those who enter the site from one country to another site. I have a module that overrides the Address class. But this class only works on the home page. When I enter the home page, I can navigate successfully. But there is no redirection when entering other pages. How can I solve this problem?

Thank you.

My code at address.php:

if($countrycode==12)
        {            
            header("Location: https://www.example.com"); 
            exit();
        }

Here I have a $countrycode variable. This code works only on the home page. How can I call this class on other pages?

Link to comment
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
×
×
  • Create New...