Jump to content

Add categories to former sitemap tab on menu


wubugs
 Share

Recommended Posts

sorry i am brand new to all this. let me try to be clear.

i have a menu at the top of my site like with any retail site: Home, Cart, Account, Products, contact. (products used to say sitemap until i changed it) When you click the "products" tab it directs you to a sitemap.php file. however i want the file contents of categories.tpl to appear instead when you click "products." Is there a way I can make this work?


here is the categories.tpl code:


{include file=$tpl_dir./breadcrumb.tpl}
{include file=$tpl_dir./errors.tpl}

{if $category->id AND $category->active}


{$category->name|escape:'htmlall':'UTF-8'}
{$nb_products|intval} {if $nb_products>1}{l s='products'}{else}{l s='product'}{/if}



{if $scenes}
<!-- Scenes -->
{include file=$tpl_dir./scenes.tpl scenes=$scenes}
{else}
<!-- Category image -->
{if $category->id_image}
getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" />
{/if}
{/if}

{if $category->description}
{$category->description}

{/if}
{if isset($subcategories)}
<!-- Subcategories -->

{/if}

{if $products}
{include file=$tpl_dir./product-sort.tpl}
{include file=$tpl_dir./product-list.tpl products=$products}
{include file=$tpl_dir./pagination.tpl}
{elseif !isset($subcategories)}

{l s='There is no product in this category.'}


{/if}
{elseif $category->id}

{l s='This category is currently unavailable.'}


{/if}


and here is the sitemap.php


<?php

include(dirname(__FILE__).'/config/config.inc.php');
include(dirname(__FILE__).'/header.php');

include(dirname(__FILE__).'/product-sort.php');

$nbProducts = intval(Product::getNewProducts(intval($cookie->id_lang), isset($p) ? intval($p) - 1 : NULL, isset($n) ? intval($n) : NULL, true));
include(dirname(__FILE__).'/pagination.php');

$smarty->assign(array(
'products' => Product::getNewProducts(intval($cookie->id_lang), intval($p) - 1, intval($n), false, $orderBy, $orderWay),
'nbProducts' => intval($nbProducts)));

$smarty->display(_PS_THEME_DIR_.'new-products.tpl');

include(dirname(__FILE__).'/footer.php');

?>


[1]: http://i.imgur.com/0GCZq.jpg

36787_edIyfby7rnCKowpYsvzl_t

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More