Jump to content

List categories and subcategories for a drop down menu


kos2

Recommended Posts

Hello friends,

I would like to make a Mega Drop Down Menu (very fashionable) with categories and subcategories of my site.
I have a basic level of php and smarty but something rather little.

I managed to list the categories, with the following code:

{foreach from=$categories item=category}
getcategoryLink($category.id_category, $category.link_rewrite)}>{$category.name|escape:'htmlall':'UTF-8'}
{/foreach}

the problem is that this only shows me the parent category. No subcategories. I have tried with foreach from = $subcategories but returns an empty value. I have also gained access to the subcategories using $blockCategTree.children.0.children (1.children, 2.children ... ..), but no such list them all. Thus the questions are:

1 - How I can do to list the categories and subcategories?
2 - How I can list for example the latest products added? I tried to copy the code blocknewproducts.tpl module and does not work. As I can list the new products on any page or block the site?

Finally, anyone know of a Spanish-language tutorial that explains these things well?

Forgive me for my English

Thank you very much,

Marcos

Link to comment
Share on other sites

  • 7 months later...

hey guys

please can you help, im going crazy here!

iv taken the following product slider code and need to change it into a category code so iv done the following :

    






           {counter start=0 assign=nbPrd}
           {foreach from=$bandmovingboxes_products item=bandmovingboxes_product name=bandmovingboxes}



getImageLink($bandmovingboxes_product.link_rewrite, $bandmovingboxes_product.id_image, 'large')}" alt="{$bandmovingboxes_product.legend|escape:htmlall:'UTF-8'}" />
getImageLink($bandmovingboxes_product.link_rewrite, $bandmovingboxes_product.id_image, 'large')}" alt="{$bandmovingboxes_product.legend|escape:htmlall:'UTF-8'}" />

{$bandmovingboxes_offer_message} {convertPrice price=$bandmovingboxes_product.price}

{$bandmovingboxes_product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'}


           {/foreach}        





 <!-- the scroller -->



 <!-- slider -->




and i changed it to the following :


    






           {counter start=0 assign=nbPrd}
           {foreach from=$bandmovingboxes_category item=bandmovingboxes_category name=bandmovingboxes}



getCatImageLink($bandmovingboxes_category.link_rewrite, $bandmovingboxes_category.id_image, 'large')}" alt="{$bandmovingboxes_category.legend|escape:htmlall:'UTF-8'}" />
getCatImageLink($bandmovingboxes_category.link_rewrite, $bandmovingboxes_category.id_image, 'large')}" alt="{$bandmovingboxes_category.legend|escape:htmlall:'UTF-8'}" />

{$bandmovingboxes_offer_message} {convertPrice price=$bandmovingboxes_category.}

{$bandmovingboxes_category.name|truncate:27:'...'|escape:'htmlall':'UTF-8'}


           {/foreach}        





 <!-- the scroller -->



 <!-- slider -->





it just shows up blank and nothing shows on the frontpage at all
Please help guys :) what am i doing wrong????

Link to comment
Share on other sites

  • 6 months later...

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