Jump to content

Storing customer information in session via a form and using it in if else type query


ecentury

Recommended Posts

On prestashop 1.5 what i am trying to do is to initally create a form on the right hand side that asks customers the following

 

So for example the form would say are you:

(1) over 50

(2) under 50

 

Then there answer is stored in a smarty session variable or cookie?

 

Then on a .tpl page, there would be if, else commands

 

if session variable 1

 

You are over 50, this might be....

 

if session variable 2

 

You are under 50, this might be....

 

else

end if

 

Can anybody please help with code to:

(1) Initially create this simple form and store the session variable?

(2) To bring back the session variable so you can use it in the if else statement?

 

Many thanks for taking the time to look

Edited by ecentury (see edit history)
Link to comment
Share on other sites

in my opinion for this is better to create module than editing the template tpl files (controllers also!)

 

create module with:

registerhook header + footer

 

in the footer add .tpl with your form (and position aligned to the right - with css styles)

in the function hookheader add a php script with if condition (if POST form then create a cookie)

 

voila ;)

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...