I am working on a site redesign going from Joomla to MODX, and would like to duplicate something from the current site, but can't find where the code is that manages this. Basically, when a user comes to the site their location is determined by IP, and it sets the URL to something like example.com/dc-metro and sets a cookie called "market" to "dc-metro". There is a dropdown on the site for a visitor to change their location, so if they select "Chicago" for example, the URL becomes example.com/chicago and the market cookie is updated to a value of "chicago". That part works great, the issue I am having is, if a user is on http://ift.tt/1JtUs68, and instead of using the dropdown to change location, they manually change the URL to http://ift.tt/1F7Zqrl, the page refreshes, but the cookie is not updated.
Is there a way to do something like $SERVER['REQUEST_URI'] (or something like that) to pull from the URL and set the cookie when the page reloads. I have several places on the site that show a variable based on the market cookie, and these are not updating (for example, on my dropdown the default value is the current market location).
Thank you very much in advance for any help.
Aucun commentaire:
Enregistrer un commentaire