Jump to content

Edit History

loic-pcpt

loic-pcpt

Here is an update :

 

In my store selector page, I set a cookie with the store id inside.

My new idea is to not mess with .htaccess, but each time "index.tpl" in rendered, check if the cookie with id store exist.

If it does not exist, I want to redirect to my store selector page.

If it exist, I want to display index.tpl.

So I want either to put php in index.tpl, or before calling index.tpl make a redirect.

 

EDIT :

So I made a override of FrontControllerCore to add new variable accessible in .tpl containing my cookie, and then in index.tpl I made a condition "if the cookie is not set, then load "store_selector.html" with js".

 

I also had to delete ./var/cache/prod/class_index.php (override cache)

loic-pcpt

loic-pcpt

Here is an update :

 

In my store selector page, I set a cookie with the store id inside.

My new idea is to not mess with .htaccess, but each time "index.tpl" in rendered, check if the cookie with id store exist.

If it does not exist, I want to redirect to my store selector page.

If it exist, I want to display index.tpl.

So I want either to put php in index.tpl, or before calling index.tpl make a redirect.

 

EDIT :

So I made a override of FrontControllerCore to add new variable accessible in .tpl containing my cookie, and then in index.tpl I made a condition "if the cookie is not set, then load "store_selector.html" with js"

loic-pcpt

loic-pcpt

Here is an update :

 

In my store selector page, I set a cookie with the store id inside.

My new idea is to not mess with .htaccess, but each time "index.tpl" in rendered, check if the cookie with id store exist.

If it does not exist, I want to redirect to my store selector page.

If it exist, I want to display index.tpl.

So I want either to put php in index.tpl, or before calling index.tpl make a redirect.

×
×
  • Create New...