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.

  • Index
  •  » ClickCartPro 6
  •  » Products begin with a number on the Product Index By Letter pages?

#1 04-12-2008 20:04:14

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Products begin with a number on the Product Index By Letter pages?

If a product name starts with a number such as a year, like "2008 Gold Commemorative Coin", how is that handled in the product index that is sorted by letter?

I know it relies on the prodidx column value of the product db table ccp0_prod. I have my working products spreadsheet set to pull the first character of the name field and place it in the prodidx column.

So if a product starts with 2008 the value entered that column would be 2... and theoretically should have its own page of all products that start with 2.

Right now apparently only letter values are recognized in that field by ccp6.

How can I alter the code so that pages will be made if it finds a number in that field, and all the products that start with that number will be listed on that number's page just like it does for the letters?

It would need to handle 1-9 along with the way it handles A-Z.


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#2 04-13-2008 05:19:57

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

Re: Products begin with a number on the Product Index By Letter pages?

theblade24 wrote:

If a product name starts with a number such as a year, like "2008 Gold Commemorative Coin", how is that handled in the product index that is sorted by letter?

Numbers are not provided as an option for indexing as CCP is delivered so a) numbers couldn't be selected and b) they wouldn't show up in the product index.

theblade24 wrote:

How can I alter the code so that pages will be made if it finds a number in that field, and all the products that start with that number will be listed on that number's page just like it does for the letters?

It should be possible by adding 9 entries to the khxc_selectcustom table for each of the numbers 1-9.  In raw DB admin enter the following:

Code:

INSERT INTO `khxc_selectcustom` VALUES('ccp0.prodidx.1', 'ccp0', 'ccp0.prodidx', '1', '1', 27)

changing the 3 instances of 1 in that command to 2, 3, 4 etc and incrementing the 27 each time (ie: 28, 29, 30 etc).

Offline

 

#3 04-13-2008 08:13:56

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Re: Products begin with a number on the Product Index By Letter pages?

Thats excellent and gives me the new pages 1-9.

They are not however appearing in the array with all the other letters so they can be selected.

Do they need to be added to that array somewhere?


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#4 04-13-2008 08:24:11

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

Re: Products begin with a number on the Product Index By Letter pages?

That would have added them to the select drop-down in the product page in admin.  That's the only place that needs to be changed.  I added the one using the command I posted, updated a product and it showed up in the index with 1 as expected.

Offline

 

#5 04-13-2008 08:39:51

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Re: Products begin with a number on the Product Index By Letter pages?

If I change a link to

/ccp0-prodidx/1.html then yes all products that start with 1 show up.

But in this array

Index: A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | R | S | T | V | W | X | Y | Z |  |  |  |  |

thats what I'm getting and the choices for 1-9 are not there.


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#6 04-13-2008 08:48:07

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

Re: Products begin with a number on the Product Index By Letter pages?

You must have changed something smile  Like I said, when I did it the 1 showed up immediately after the Z.  In a stock installation only letters that have products assigned to them will show up (FWIW).  Looking at the source of your index page it does look like you've changed the include that displays the index so that would be the first place to check sir.

Offline

 

#7 04-13-2008 08:57:45

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Re: Products begin with a number on the Product Index By Letter pages?

I'm assuming you mean this include?   Product Index Nav Display

I took my code saved as a file, went to the demo install and got the code there and saved as another file.

I used a file compare tool and they are identical. I haven't changed anything.


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#8 04-13-2008 09:02:19

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Re: Products begin with a number on the Product Index By Letter pages?

I see I'm also getting |  |  |  |  | at the end.... but that was there before I added the 1-9 items. So something is causing that for some reason.


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#9 04-13-2008 09:47:22

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

Re: Products begin with a number on the Product Index By Letter pages?

That may be caused by a product entry not having a value in the index column.  You're importing you products from a CSV if I recall correctly.  May want to check the index column and see if you have any that are blank or have other non alphameric values.

Offline

 

#10 04-13-2008 09:50:03

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

Re: Products begin with a number on the Product Index By Letter pages?

In a normal installation the only letters that should show up on the index line are those that have products associated with them.  My development line looks like this for example:

Index: B | E | F | G | M | N | O | P | Purple | S | T | 1

Offline

 

#11 04-13-2008 10:17:42

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Re: Products begin with a number on the Product Index By Letter pages?

I just went up and down my file and there is nothing in that column but A-Z or 1-9. Unfortunately.

I removed 20 or so entries in that column that had numbers   like 1 2 3 4 5 that were because products start with that letter.

Uploaded file, and poof... those extra ||||| at the end of the display were gone.

Ideas?


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#12 04-13-2008 10:32:35

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

Re: Products begin with a number on the Product Index By Letter pages?

Quite odd.  After I added the numbers to the custom select table as shown earlier my test product that I set the index to 1 showed up just like it was supposed to.

Offline

 

#13 04-13-2008 10:42:50

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Re: Products begin with a number on the Product Index By Letter pages?

Any ideas of where to go next?


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#14 04-13-2008 11:49:43

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Re: Products begin with a number on the Product Index By Letter pages?

I can see in the product table where a product has the proper dropdown selection of 1 for the prodidx field.

And it is found if I manually alter the url to 1.html.

But I am getting the pipes at the end of the nav listing and it won't show the letter choices.

If I clear the products db of any numbers in the prodidx column, no pipes appear and all is good.

What could be causing the way it is handling the number values in that column?


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#15 04-13-2008 13:31:26

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

Re: Products begin with a number on the Product Index By Letter pages?

Ah I think I know what it is.  In the product index include look for this line:

Code:

$idx  = $data['prodidx'];

and change it to:

Code:

$idx  = $data;

Offline

 

#16 04-13-2008 14:22:13

theblade24
Member
From: Tampa, Florida
Registered: 11-19-2003
Posts: 384
Website

Re: Products begin with a number on the Product Index By Letter pages?

Spot on Mate! That did the trick!

Any idea why it worked for you?
"Quite odd.  After I added the numbers to the custom select table as shown earlier my test product that I set the index to 1 showed up just like it was supposed to."


CCP 5.1
CCP 5.1
CCP 5.1

Offline

 

#17 04-13-2008 14:27:02

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

Re: Products begin with a number on the Product Index By Letter pages?

Yea, I have a change to that include that will be in the next update and I'd forgotten about it completely.  I discovered that while helping someone use words for indexing instead of just letters.  After I walked away from the computer for a while doing other things it dawned on me smile

Offline

 
  • Index
  •  » ClickCartPro 6
  •  » Products begin with a number on the Product Index By Letter pages?

Board footer