PHP scripting Prestashop theme

I have my own custom theme integrated into prestashop

You will see what I mean if you go here:
 
www.idiotcycles.com/newsite
Then select any of the 4 catalogues

Then switch between the 4 catalogues using the 4 selector icons you will notice the menus change.

My question is how can I get the active menu to follow the user throughout their shopping.  As they browse I want the menu to stay with them not disapear.  I realize I can probably do this through the url as it is done on the category.php page

http://www.idiotcycles.com/newsite/category.php?id_category=6

How can I most effectively make this happen?  Do I need to add a line of code to each of the other pages to look for the active category?  If so, what would it look like?

Code for header.tpl is attached, the only place where this is dealt with currently.

 







<body {if $page_name}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if}>
	{if !$content_only}
		<noscript><ul><li>{l s='This shop requires JavaScript to run correctly. Please activate JavaScript in your browser.'}</li></ul></noscript>
		<div id="page">

				<!--<h1 id="logo"><a href="{$base_dir}" title="{$shop_name|escape:'htmlall':'UTF-8'}"><img src="{$img_ps_dir}logo.jpg" alt="{$shop_name|escape:'htmlall':'UTF-8'}" /></a></h1>-->

				<div id="header">
				
					{$HOOK_TOP}
								
				</div>
	
                {if $home neq 'yes' and $cat_id eq '2' or $parentID eq '2'}
                <div style="margin-left: -1.8px; margin-right: -1px; padding-top: 261px;">
                    <ul id="nav3">
	                    {section name=parentmenu loop=$mainmenu}
							<li class="top"><a href="category.php?id_category={$mainmenu[parentmenu].id_category}" class="top_link"><span class="down">{$mainmenu[parentmenu].name}</span></a>
						 {if $mainmenu[parentmenu].sub_menus neq "0"}
						 	{$mainmenu[parentmenu].sub_menus}
						 {/if}
						 </li>
						 {/section}
						 </ul>
					 </div>
			
			{elseif $home neq 'yes' and $cat_id eq '3' or $parentID eq '3'}
			 <div style="margin-left: -1.8px; margin-right: -1px; padding-top: 261px;">
					<ul id="nav1">
						{section name=parentmenu loop=$mainmenu}
							<li class="top"><a href="category.php?id_category={$mainmenu[parentmenu].id_category}" class="top_link"><span class="down">{$mainmenu[parentmenu].name}</span></a>
						 {if $mainmenu[parentmenu].sub_menus neq "0"}
						 	{$mainmenu[parentmenu].sub_menus}
						 {/if}
						 </li>
						 {/section}
					</ul>
		</div>
			
			{elseif $home neq 'yes' and $cat_id eq '5' or $parentID eq '5'}
			 <div style="margin-left: -1.8px; margin-right: -1px; padding-top: 260px;">
			 <ul id="nav2">
					{section name=parentmenu loop=$mainmenu}
							<li class="top"><a href="category.php?id_category={$mainmenu[parentmenu].id_category}" class="top_link"><span class="down">{$mainmenu[parentmenu].name}</span></a>
						 {if $mainmenu[parentmenu].sub_menus neq "0"}
						 	{$mainmenu[parentmenu].sub_menus}
						 {/if}
						 </li>
						 {/section}
					</ul>
					</div>
			{elseif $home neq 'yes' and $cat_id eq '6' or $parentID eq '6'}
			 <div style="margin-left: -1.8px; margin-right: -1px; padding-top: 260px;">
			 <ul id="nav4">
						{section name=parentmenu loop=$mainmenu}
							<li class="top"><a href="category.php?id_category={$mainmenu[parentmenu].id_category}" class="top_link"><span class="down">{$mainmenu[parentmenu].name}</span></a>
						 {if $mainmenu[parentmenu].sub_menus neq "0"}
						 	{$mainmenu[parentmenu].sub_menus}
						 {/if}
						 </li>
						 {/section}
						</ul>
				 </div>
			{else}
				<div><table><tr><td height="270">&nbsp;</td></tr></table></div> 
			{/if}	

			{if $home neq 'yes'}
				<!-- Left -->
				<div id="left_column" class="column">
					{$HOOK_LEFT_COLUMN}
				</div>
			{/if}

			<!-- Center -->
			<div id="center_column" {if $home eq 'yes'}style="display:none;"{/if}>
			
	{/if}

Open in new window

jesterboneAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

midhungirishCommented:
You must save the category that the user selected in the $_COOKIE variable and use that information to set the nav bar.... You can save the category in the $_COOKIE variable when ever id_category comes through get method..... This way you can set the nav bar for all pages without having id_category in the url...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.