Jump to content

Categories in Shop by Category


Guest

Recommended Posts

In Shop by Category, lets say I have the following...

Apples

Oranges

Bananas

Peaches

Peanuts

Now, a year after I have those, I want to add Corn. I am under the impression that when I add Corn, it will be at the top of the Categories? I dont want that to happen, I may want it between Peaches and Peanuts, or etween Oranges and Bananas.

Because, (if) thats how it works, it would seem to me that users of Cube would have some trepidation about adding Categories because they'd have to delete all pre-existing Catefories and re-add them in the order they want, along with all the pricing, colors, sizes, whatever.

Is that how it works, please?

Link to comment
Share on other sites

Would you like to have top categories always ordered by name? There is a simple hack:

includes/boxes/categories.inc.php

SEARCH FOR

WHERE cat_father_id = 0


REPLACE WITH


WHERE cat_father_id = 0 ORDER BY cat_name ASC

Thx. Being the n00b that I obviously am, I'm not sure I understand,"Would you like to have top categories always ordered by name?" What I'd like, in the case of my original scenario is to be able to put Corn anywhere I desire, way after I've already put my products in the other Categories without having to redo all of them, each time I want to add a category and its products.

Link to comment
Share on other sites

Would you like to have top categories always ordered by name? There is a simple hack:

includes/boxes/categories.inc.php

SEARCH FOR

WHERE cat_father_id = 0


REPLACE WITH


WHERE cat_father_id = 0 ORDER BY cat_name ASC

Thx. Being the n00b that I obviously am, I'm not sure I understand,"Would you like to have top categories always ordered by name?" What I'd like, in the case of my original scenario is to be able to put Corn anywhere I desire, way after I've already put my products in the other Categories without having to redo all of them, each time I want to add a category and its products.

This is NOT standard CubeCart feature.
Link to comment
Share on other sites

You'd have to manually code your categories in /skins/yourskin/styleTemplates/boxes/categories.tpl. I do this on several of my stores so I can have multiple methods of shopping. Just replace the auto generating code with...

<div class="boxTitleLeft">{LANG_CATEGORY_TITLE}</div>

<div class="boxContentLeft">

	<ul>

		<li class="bullet"><a href="index.php?act=viewCat&catId=1" class="txtDefault">Cat name 1</a></li>

		<li class="bullet"><a href="index.php?act=viewCat&catId=2" class="txtDefault">Cat name 2</a></li>

	</ul>

</div>

Cubecart assigns the catid depending on when you add it, but you can put them manually in any order you want.

You do not need to re-enter everything though. The database will just pull all the "corn" items in whenever it is clicked. The link to the category has nothing to do with the category and it's data itself.

Link to comment
Share on other sites

Nice job Mysty */*

heheh Thanks ;) Hardest part is answering things so that more than me can understand the answers! lol Helps when it's something I have done and I admit, I've made a LOT of changes in my stores - just don't always remember HOW I did them! :P If I did, I'd actually publish some mods!

Link to comment
Share on other sites

  • 3 weeks later...
Guest christianchoice

You'd have to manually code your categories in /skins/yourskin/styleTemplates/boxes/categories.tpl. I do this on several of my stores so I can have multiple methods of shopping. Just replace the auto generating code with...

<div class="boxTitleLeft">{LANG_CATEGORY_TITLE}</div>

<div class="boxContentLeft">

	<ul>

		<li class="bullet"><a href="index.php?act=viewCat&catId=1" class="txtDefault">Cat name 1</a></li>

		<li class="bullet"><a href="index.php?act=viewCat&catId=2" class="txtDefault">Cat name 2</a></li>

	</ul>

</div>

Cubecart assigns the catid depending on when you add it, but you can put them manually in any order you want.

You do not need to re-enter everything though. The database will just pull all the "corn" items in whenever it is clicked. The link to the category has nothing to do with the category and it's data itself.

may i see an example of one those stores? & What code do you replace in the categories.inc.php file?

Link to comment
Share on other sites

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