X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   i really need help please. $parentid and $categoryid (https://forum.x-cart.com/showthread.php?t=12096)

mpj 02-10-2005 03:04 PM

i really need help please. $parentid and $categoryid
 
First I want to say thanks html_sucks for this original code
http://forum.x-cart.com/viewtopic.php?t=14905&highlight=subcategories




I made a few changes using his code in order to display subcategories on top of the menu.


Here what is looks like:





Home page menu display
----------------------
- Books
- CD - DVD - Video
----------------------

// 1st tier




When you click on books, the menu changes to
----------------------
Categories in this section are:
Internet (6)
Software (4)

- Books
Internet (6)
Software (4)
- CD - DVD - Video
----------------------

// 2nd tier




But when I click on the Internet section of the subcategory, the menu changes back to
----------------------
- Books
- CD - DVD - Video
----------------------

// 3rd tier



I think X-cart uses {parentid} to display for the 1st and 2nd tiers and then uses {categoryid} for the 3rd tier.
They did this so that the 3rd tier would have a default category by its own.

for example.

Your Company Name :: Books :: Internet :: PHP book
{parentid} {parentid} {categoryid} {categoryid}

You can click on Internet and see a list of PHP books.


It's when I click on the 3rd tier, this code doesn't function.


Please help!



Here is the code:

In my categories.tpl

Code:

{capture name=menu}

{section name=cat_num loop=$subcategories}

{if $subcategories[cat_num].product_count eq "0" }



<a href="home.php?cat={ $subcategories[cat_num].categoryid }" class="ProductTitle">
{ $subcategories[cat_num].category|escape }</a>


{elseif $subcategories[cat_num].subcategory_count gte "0"}


<a href="home.php?cat={ $subcategories[cat_num].categoryid }" class="ProductTitle">
{ $subcategories[cat_num].category|escape }</a>

({$subcategories[cat_num].product_count})


{/if}
{/section}


4pawsdesign 02-10-2005 08:16 PM

I was thinking of doing the same thing as well, but I am going to look into it later.

I just wanted to get the site up and running, and will redo the menu later, so the they drop down under the categories.

My best suggestion is just to copy the original located in the shop/skin1_original directory and start again, which will at least give you something to get working.

I know this isn't much help.
Can you let me know how you get on?
Regards
Lindsay

mpj 02-11-2005 08:30 AM

Hi Lindsay

Thanks for the reply. I'm not sure I understand your question.


I'm still looking into this. If someone can explain the tiers of menu, categories and subcategories, maybe that would help.


All times are GMT -8. The time now is 01:10 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.