Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 03-23-2007 07:57:12

rtpHarry
Member
From: Lincoln, UK
Registered: 03-08-2007
Posts: 20
Website

alpha sort my product categories

It seems strange that I have to manually index my categories when the code could easily do this for me.

Is there a way that I can have my main menu categories auto alpha-sorted rather than having to specify a numerical index for each one?

I tried setting all to an index of 0 thinking that it would alpha sort matching values but it still comes out in a random order.

Nick if you read this I remember seeing you mention that the automatic menu's are only provided for people that couldn't edit the skins themselves. Was it your intention that I should add the categories into my template manually as well?

Offline

 

#2 03-24-2007 15:36:58

grcauto
Member
From: Bloomsburg, PA
Registered: 09-11-2006
Posts: 128
Website

Re: alpha sort my product categories

If you number them all the same I believe the program will list them in the sequence they are in the database. You could rearrange them in ClickCartPro > Catalog: Categories, Products and Options>Manage Online Store Products or it may be easier to export the ccp0_prod table and arrange it the way you want and import it back. I haven't done this so I'm not sure if it's easier to do or not, but it's an option.

Last edited by grcauto (03-24-2007 15:44:21)

Offline

 

#3 03-25-2007 06:40:31

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: alpha sort my product categories

rtpHarry wrote:

Is there a way that I can have my main menu categories auto alpha-sorted rather than having to specify a numerical index for each one?

There is but you'll have to edit a couple of core files and they are subject to being updated.  In {private}/apps/{app}/CCP_Cat/CCP_Cat.php around line 403 look for

Code:

$result = $this->KHXC_DB->sql_do(array('sql'    => $sql,
                                       'table'  => $table,
                                       'order'  => array('sortorder' => 'ASC')));

Change the 'sortorder' in that statement to 'name' and your categories should be sorted by name on the store home page.

Code:

$result = $this->KHXC_DB->sql_do(array('sql'    => $sql,
                                       'table'  => $table,
                                       'order'  => array('name' => 'ASC')));

To change the order in the menu on the left side you'll need to edit {private}/apps/{app}/CCP/ext/femenus.php and make the same change at line 567.  When done it should look like this:

Code:

$result = $this->KHXC_DB->sql_do(array('sql'    => $sql,
                                       'table'  => $table,
                                       'order'  => array('name' => 'ASC')));

Offline

 

#4 05-15-2007 12:38:55

ejgroves
Member
From: South Wales - UK
Registered: 05-12-2007
Posts: 47
Website

Re: alpha sort my product categories

Can anyone help.  My sort has stopped working.  I removed the web map line under the menu bar and removed the sort heading.  I'm really not sure where to go from hear.  I need my products to be listed in order.  I've tried the identifiers and entered the product sort code, but it makes no difference.  the products are just listing in any order.

Offline

 

#5 05-15-2007 19:21:54

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: alpha sort my product categories

e.j.groves wrote:

I removed the web map line under the menu bar and removed the sort heading.

What's a web map line?  Removing the header line with the sorting options shouldn't affect anything.

e.j.groves wrote:

I'm really not sure where to go from hear.  I need my products to be listed in order.  I've tried the identifiers and entered the product sort code, but it makes no difference.  the products are just listing in any order.

Have you attempted any of the code changes outlined earlier in this thread?

Offline

 

#6 04-01-2009 17:21:17

lucky2628
Member
Registered: 04-01-2009
Posts: 10

Re: alpha sort my product categories

sortorder*

Column Metadata:

BIGINT(20) DEFAULT '0' NOT NULL

how to chang the BIGINT(20) to 50

Offline

 

#7 04-01-2009 18:30:17

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: alpha sort my product categories

There's no need/reason to change it.  A big integer field may hold a value into the trillions and I sincerely hope you have fewer than that products in your store.

Offline

 

#8 04-02-2009 04:46:16

lucky2628
Member
Registered: 04-01-2009
Posts: 10

Re: alpha sort my product categories

i have 50 category, sortorder only 20, so i want change it to 50

Offline

 

#9 04-02-2009 06:35:51

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: alpha sort my product categories

That number is not related to the values that may be stored in the column.  The field is BIGINT which may hold a value into the trillions.  The 20 is only a hint at how many digits to display and does not restrict the values that may be stored in the column.  You don't need to change it.

Offline

 

#10 04-05-2009 01:07:28

lucky2628
Member
Registered: 04-01-2009
Posts: 10

Re: alpha sort my product categories

where to edit this file {private}/apps/{app}/CCP_Cat/CCP_Cat.php

Offline

 

#11 04-06-2009 03:29:40

lucky2628
Member
Registered: 04-01-2009
Posts: 10

Re: alpha sort my product categories

where to edit this file {private}/apps/{app}/CCP_Cat/CCP_Cat.php
i would like to change the sortorder

Code:

$result = $this->KHXC_DB->sql_do(array('sql'    => $sql,
                                       'table'  => $table,
                                       'order'  => array('sortorder' => 'ASC')));

Offline

 

Board footer