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)
-   -   Sort Order for menu. please help (https://forum.x-cart.com/showthread.php?t=19166)

kostia 01-10-2006 10:57 AM

Sort Order for menu. please help
 
Recently I've found mod in this forum for showing categories and subcategories sorted - /customer/categories.tpl
works fine but sorting order for categories doesn't match the one in admin. anyone can suggest why this happens?

Code:

{* $Id: categories.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *}
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"}
{else}

{if $config.General.root_categories eq "Y"}

{section name=cat_num loop=$categories}

{* Determine if this category has a subcategory *}
{section name=subcat loop=$allcategories}
{if $allcategories[subcat].parentid eq $categories[cat_num].categoryid}
{assign var="subs" value="yes"}
{/if}
{/section}

{if $subs ne 'yes'}

{* This category has no subcategories, so display the category name with a link *}
{if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid}

{$categories[cat_num].category}
 
{else}
{$categories[cat_num].category}

 

{/if}

{else}

{* This category has subcategories, so display the category name without a link *}
{if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid}

{$categories[cat_num].category}
 
{else}
{$categories[cat_num].category}


 

{/if}

{/if}

{* Display the subcategories *}
{section name=subcat loop=$allcategories}
{if $allcategories[subcat].parentid eq $categories[cat_num].categoryid}›{if $cat eq $allcategories[subcat].categoryid}{/if}{$allcategories[subcat].category}{if $cat eq $allcategories[subcat].categoryid}{/if}
 
{/if}
{/section}

{* reset the subcategory switch *}
{assign var="subs" value="no"}

{/section}
{else}
{section name=cat_num loop=$subcategories}
<FONT class="CategoriesList">{$subcategories[cat_num].category}</FONT>
 
{/section}

{/if}
{/if}
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }

{ $subcat.category|escape }


balinor 01-10-2006 12:38 PM

http://forum.x-cart.com/viewtopic.php?t=1695

kostia 01-11-2006 12:58 AM

Quote:

Originally Posted by balinor
http://forum.x-cart.com/viewtopic.php?t=1695


this topic is for old x-cart and the posts are also old. I need the info for 4.0.17 please

balinor 01-11-2006 03:19 AM

It still applies.

kostia 01-11-2006 03:21 AM

Quote:

Originally Posted by balinor
It still applies.


There is no code like that. please check and you will ensure.

balinor 01-11-2006 03:23 AM

Of course it is not exact, I mean the concept still applies. Look at the code in include/categories.php and you will see the orderby option.

kostia 01-11-2006 03:26 AM

Quote:

Originally Posted by balinor
Of course it is not exact, I mean the concept still applies. Look at the code in include/categories.php and you will see the orderby option.


As I asked I'm newbie, I don't know how to edit ;) that's why I ask for help
please.

garryhs 03-15-2006 01:35 PM

Category Sort Order
 
Why do X-CART do this ?

The Answer is: I do not know, perhaps a bug.

I have not looked at issues relating to making this change, the the reason the categories are in alphabetical order or the order that you enetred them into the admin section is that they are doing a usort on the category path.

Again, I am just quickly looking at a site for a client and found this thread and issue as my client has the same problem.

For anybody with this problem, try and comment out the following line from your /include/categories.php in 4.0.17

Change:

usort($all_categories, "func_categories_sort");

To:

//usort($all_categories, "func_categories_sort");

Somebody else who has looked at this, may explain why xcart is doing this, but I have no time, as we are very busy at present.

X-CART may want to look at this, as it seems that the order_by column is useless.

youngvet1 06-21-2006 02:22 PM

I have looked through the posts and I am still having trouble making just the subcategories be listed alphabetically.
I would really appreciate if someone could suggest what must be done to make the subcategories list alphabetically.


All times are GMT -8. The time now is 12:16 AM.

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