Jump to content

Sub Catagorie


Guest Maneatdog

Recommended Posts

Yes and it depends on how you want to sort them. If you want to sort them alphabetically do this:

Open /includes/contents/viewCat.inc.php

Find somewhere @ line 158

QUOTE

$productListQuery = "SELECT ".$glob['dbprefix']."CubeCart_cats_idx.cat_id, ".$glob['dbprefix']."CubeCart_cats_idx.productId, productCode, quantity, description, image, price, name, popularity, sale_price, stock_level, useStockLevel FROM ".$glob['dbprefix']."CubeCart_cats_idx INNER JOIN ".$glob['dbprefix']."CubeCart_inventory ON ".$glob['dbprefix']."CubeCart_cats_idx.productId = ".$glob['dbprefix']."CubeCart_inventory.productId WHERE ".$glob['dbprefix']."CubeCart_cats_idx.cat_id = ".$db->mySQLSafe($_GET['catId']);

Replace it with

QUOTE

$productListQuery = "SELECT ".$glob['dbprefix']."CubeCart_cats_idx.cat_id, ".$glob['dbprefix']."CubeCart_cats_idx.productId, productCode, quantity, description, image, price, name, popularity, sale_price, stock_level, useStockLevel FROM ".$glob['dbprefix']."CubeCart_cats_idx INNER JOIN ".$glob['dbprefix']."CubeCart_inventory ON ".$glob['dbprefix']."CubeCart_cats_idx.productId = ".$glob['dbprefix']."CubeCart_inventory.productId WHERE ".$glob['dbprefix']."CubeCart_cats_idx.cat_id = ".$db->mySQLSafe($_GET['catId'])." ORDER BY name ASC";

Link to comment
Share on other sites

have my print sub catagories under the picture rather than above

Sure, Open skins/Classic/styleTemplates/content/viewCat.tpl.

Fine the following block of code:

<!-- BEGIN: sub_cats -->

<div id="subCats">

	<!-- BEGIN: sub_cats_loop -->

	<div class="subCat">

		<a href="index.php?act=viewCat&amp;catId={TXT_LINK_CATID}" class="txtDefault"><img src="{IMG_CATEGORY}" alt="{TXT_CATEGORY}" border="0" title="{TXT_CATEGORY}" /></a><br />

		<a href="index.php?act=viewCat&amp;catId={TXT_LINK_CATID}" class="txtDefault">{TXT_CATEGORY}</a> ({NO_PRODUCTS})

	</div>

	<!-- END: sub_cats_loop -->

</div>

<!-- END: sub_cats -->

<br clear="left" />

<!-- BEGIN: cat_img -->

<img src="{IMG_CURENT_CATEGORY}" alt="{TXT_CURENT_CATEGORY}" border="0" title="{TXT_CURENT_CATEGORY}" />

<!-- END: cat_img -->




REPLACE it with this block of code:




<!-- BEGIN: cat_img -->

<img src="{IMG_CURENT_CATEGORY}" alt="{TXT_CURENT_CATEGORY}" border="0" title="{TXT_CURENT_CATEGORY}" />

<!-- END: cat_img -->

<!-- BEGIN: sub_cats -->

<div id="subCats">

	<!-- BEGIN: sub_cats_loop -->

	<div class="subCat">

		<a href="index.php?act=viewCat&amp;catId={TXT_LINK_CATID}" class="txtDefault"><img src="{IMG_CATEGORY}" alt="{TXT_CATEGORY}" border="0" title="{TXT_CATEGORY}" /></a><br />

		<a href="index.php?act=viewCat&amp;catId={TXT_LINK_CATID}" class="txtDefault">{TXT_CATEGORY}</a> ({NO_PRODUCTS})

	</div>

	<!-- END: sub_cats_loop -->

</div>

<!-- END: sub_cats -->

<br clear="left" />

If you look at the code with a good text editor, you'll see that the two areas of code are clearly marked, so it is not difficult to move things around a bit. sub_cats vs. cat_img ;)

Link to comment
Share on other sites

  • 4 weeks later...
Guest luvs2ride1979

A question for you all along this line (will be adding the alphabetical code shortly!). I want my subcategories to be displayed in a list format, down the left. I got rid of the icons and I got it left aligned, but they're all bunched up together... Any of you know off hand how I can get a BR between each one or put them in a bullet list?

Link: (site in testing/development stage) http://rescuenetwork.com/tack

Thanks!

Link to comment
Share on other sites

Well hello, luvs2ride!

Yes, this can be done. Try the following:

1. Make a copy of the entire Legend folder on your pc, this contains all the skin files for Legend skin.

2. Do not modify any files in your original Legend skin folder.

3. Re-name the copy folder to newLegend, or myLegend, or mySkin - whatever you'd like to call it. You will be modifying these files to get the skin to look and operate the way you want it to.

4. Upload your new skin folder to the skins/ directory at your site.

5. In admin control panel for the store, under Store Config > General Settings, choose your new skin name from the dropdown menu. It will appear there automatically if your new skin file is in the skins/ directory.

NOW that you have secured the purity of your original Legend skin, follow these instructions to change the appearance of your subcategories:

OPEN skins/<new name>/styleTemplates/content/viewCat.tpl

FIND the following block of code:

<!-- BEGIN: sub_cats -->

<div id="subCats">

	<!-- BEGIN: sub_cats_loop -->

	<span class="subCat">

		<a href="index.php?act=viewCat&catId={TXT_LINK_CATID}" class="txtDefault"><img src="{IMG_CATEGORY}" alt="{TXT_CATEGORY}" border="0" title="{TXT_CATEGORY}" /></a><br />

		<a href="index.php?act=viewCat&catId={TXT_LINK_CATID}" class="txtDefault">{TXT_CATEGORY}</a> ({NO_PRODUCTS})

	</span>

	<!-- END: sub_cats_loop -->

</div>

<!-- END: sub_cats -->




REPLACE it with this block of code:




<!-- Modified for subcategories in a list format, MarksCarts http://cc3.biz >> -->

<!-- BEGIN: sub_cats -->

<div class="boxContent"><span class="txtContentTitle">Choose a Category:</span>

	<ul style="margin-left: 3em">

	<!-- BEGIN: sub_cats_loop -->

	<li class="bullet">

	<a href="index.php?act=viewCat&catId={TXT_LINK_CATID}" class="txtDefault">{TXT_CATEGORY}</a> ({NO_PRODUCTS})

	</li>

	<!-- END: sub_cats_loop -->

	</ul>

</div>

<!-- END: sub_cats -->

<!-- << Modified for subcategories in a list format, MarksCarts http://cc3.biz >> -->

Link to comment
Share on other sites

Guest luvs2ride1979

Well hello, luvs2ride!

Yes, this can be done. Try the following:

That Worked! THANKS! Now I just have to go screw with my style sheet to make it readable :w00t: For some reason, the 70% setting in the Legend skin for bullet font size is making the subcat font size TINY! I figured it would be the same as the block menu, but it's much smaller... I can do style sheets though, lol.

Thanks again!!

~Barbara

Link to comment
Share on other sites

Guest luvs2ride1979

That Worked! THANKS! Now I just have to go screw with my style sheet to make it readable :w00t: For some reason, the 70% setting in the Legend skin for bullet font size is making the subcat font size TINY! I figured it would be the same as the block menu, but it's much smaller... I can do style sheets though, lol.

Thanks again!!

~Barbara

I FIXED IT! Since the new list was labled "box content" as the style, it shrunk everything down to 75% again (75% of 75%). I made a new style, boxcontent2 with no borders and everything 100%. I also made the li style "bulletLrg". Here's the code I ended up with:

<!-- Modified for subcategories in a list format, MarksCarts http://cc3.biz >> -->

<!-- BEGIN: sub_cats -->

<div class="boxContent2"><span class="txtContentTitle">Choose a Category:</span>

<ul style="margin-left: 3em">

<!-- BEGIN: sub_cats_loop -->

<li class="bulletLrg">

<a href="index.php?act=viewCat&catId={TXT_LINK_CATID}" class="txtDefault">{TXT_CATEGORY}</a> ({NO_PRODUCTS})

</li>

<!-- END: sub_cats_loop -->

</ul>

</div>

<!-- END: sub_cats -->

<!-- << Modified for subcategories in a list format, MarksCarts http://cc3.biz >> -->

Here's a link to show how it ended up (used the breadcrumb thing for navigation too): http://rescuenetwork.com/tack/index.php?act=viewCat&catId=21

Thanks again for your help!

~Barbara

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...