{assign var=tplSuffix value=['index'=>'_home', 'product'=>'_productOverview','category'=>'_products','cms'=>'_pageTemplate','pagenotfound'=>'_template404','order'=>'_shoppingCartTemplate','module-cheque-payment'=>'_shoppingCartTemplate','module-bankwire-payment'=>'_shoppingCartTemplate','module-cashondelivery-validation'=>'_shoppingCartTemplate']}
{assign var=pathSuffix value='' scope="global"}
{if isset($tplSuffix[$page_name]) && $tplSuffix[$page_name]}
	{assign var=pathSuffix value=$tplSuffix[$page_name]}
{/if}

{if !empty($display_header)}
	{if file_exists("$tpl_dir./header$pathSuffix.tpl")}
		{include file="$tpl_dir./header$pathSuffix.tpl" HOOK_HEADER=$HOOK_HEADER}
	{elseif file_exists("$tpl_dir./header.tpl")}
		{include file="$tpl_dir./header.tpl" HOOK_HEADER=$HOOK_HEADER}
	{/if}
{/if}
{if !empty($template) && ($page_name !== 'pagenotfound')}
	{$template}
{/if}
{if !empty($display_footer)}
	{if file_exists("$tpl_dir./footer$pathSuffix.tpl")}
		{include file="$tpl_dir./footer$pathSuffix.tpl"}
	{elseif file_exists("$tpl_dir./footer.tpl")}
		{include file="$tpl_dir./footer.tpl"}
	{/if}
{/if}
{if !empty($live_edit)}
	{$live_edit}
{/if}