Forums / General Questions / Changing Category_ID to VARCHAR

Changing Category_ID to VARCHAR

Views: 816

Results 1 to 5 of 5
18 Feb 2012, 2:31 AM
#1
tharrison avatar

tharrison

New Zenner

Join Date:
Jan 2005
Location:
Austin, TX
Posts:
83
Plugin Contributions:
0

Changing Category_ID to VARCHAR

The inventory spreadsheet a client gave me has variable characters for category codes instead of integers, i.e. AC=Accessories

These are the changes I made to each of the following tables:

Categories
categories_id varchar(11) AC
parent_id varchar(11) AC

Categories_Description
categories_id varchar(11) AC

Products
master_categories_id varchar(11) AC

Products-to-Categories
categories_id varchar(11) AC

The categories are listed correctly in the categories box on the site. The products show in the different product areas such as new products. But, If i click on the Accessories category link, none of the products for the category show.

Also on the admin dashboard it's showing the 1303 product count, but no categories or products show in the admin catalog area.

What have I missed or is this even a viable way to be able to import inventory without having to set up some extreme excel mapping formulas crap??

18 Feb 2012, 4:45 AM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Changing Category_ID to VARCHAR

Any category-handling code in Zen Cart will be set up to work with integer ids, and non-integer content may cause malfunctions in numerous places - impossible to say where without a thorough review of the code. I don't think it is feasible to convert everything to use your external ids; you will need to do some mapping.

18 Feb 2012, 4:49 AM
#3
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,678
Plugin Contributions:
0

Re: Changing Category_ID to VARCHAR

Glenn is correct. You will have massive problems if you try to change the ID handling.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

18 Feb 2012, 4:52 AM
#4
tharrison avatar

tharrison

New Zenner

Join Date:
Jan 2005
Location:
Austin, TX
Posts:
83
Plugin Contributions:
0

Re: Changing Category_ID to VARCHAR

Thanks for the reply gjh42. I felt that would be the answer, but you never know unless you ask. Do you happen to know of a handy open-source excel mapping tool or something of the like? I'm excel tarded :blink: