Forums / Setting Up Categories, Products, Attributes / How-To: Add new Properties to your Products

How-To: Add new Properties to your Products

Views: 144,143

Results 21 to 40 of 272
5 Aug 2007, 4:13 PM
#21
elbasha avatar

elbasha

New Zenner

Join Date:
Aug 2007
Posts:
36
Plugin Contributions:
0

How-To: Add new Properties to your Products

Can someone please help me? I don't understand the first step. Where do I change what you are talking about? I don't see anywhere where it just says Product. Please help me.

Step 1 is what I don't understand.

5 Aug 2007, 4:14 PM
#22
elbasha avatar

elbasha

New Zenner

Join Date:
Aug 2007
Posts:
36
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

Please someone can help? I don't understand step 1. What exactly and where exactly you want me to change this? I don't see a table anywhere.. Can you please give me specific steps. And what exactly do I want to write if I want to add physical condition and warranty as the options?

6 Aug 2007, 3:30 AM
#23
magneteye avatar

magneteye

Zen Follower

Join Date:
Mar 2007
Location:
Portland, OR
Posts:
163
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

You need to open up your database and add your new properties to the "products" table.

You can probably do this using MyPHPAdmin through your webhosts control panel.

6 Aug 2007, 4:02 AM
#24
elbasha avatar

elbasha

New Zenner

Join Date:
Aug 2007
Posts:
36
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

Okay,
Here is what I got now.

Add 1 field(s) At End of Table, then clicked next.

Field TypeDocumentation Length/Values1 Collation Attributes Null Default2 Extra Primary Index Unique --- Fulltext Comments

I got that in a line and under it they tell me to choose what I want. Also they ask where I want to store this in.

I didn't know what to put in there. Any help?

6 Aug 2007, 8:45 AM
#25
k4satin avatar

k4satin

New Zenner

Join Date:
Mar 2006
Location:
Sacramento, CA
Posts:
93
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

ElBasha:

Okay,
Here is what I got now.

Add 1 field(s) At End of Table, then clicked next.

Field TypeDocumentation Length/Values1 Collation Attributes Null Default2 Extra Primary Index Unique --- Fulltext Comments

I got that in a line and under it they tell me to choose what I want. Also they ask where I want to store this in.

I didn't know what to put in there. Any help?

I'm not sure if I can help, but it worked for me. I got the exact same line of fields that you show here (starting with 'Field'...). I filled in the ones that crazy_chris mentioned & left the rest blank (unless I knew I wanted something else, such as 'unique').

I didn't have a question after this about where to store info, but did have a question on the 'Add 1 field' line. It gave me the option to add at the beginning, end, or after a specified field. Nothing else regarding 'where'. Were you already in your 'products' table when you clicked on 'Add 1 field..."?

6 Aug 2007, 8:59 AM
#26
k4satin avatar

k4satin

New Zenner

Join Date:
Mar 2006
Location:
Sacramento, CA
Posts:
93
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

Yeah! Only one day, and it works!!! (I had to focus on my live site for awhile, and just got back to working on this...)

It took me longer to uninstall the Additional Products Fields mod than it did to create fields using this method!

I made one mistake that I caught and thought I'd share, just in case somebody else has the same problem. When I finished all the instructions, I had the fields in the product pages in Admin & could enter data, but they didn't show up on my site in my product info display.

It turns out I'd tried to use the override system in a place where it doesn't work. I knew you couldn't use overrides in the admin section, but usually should in the storefront section. I tried to use zen overrides for includes/modules/pages/product_info/main_template_vars.php
When I was trying to figure out what went wrong, I remembered that there was one section of the storefront that doesn't accept overrides either, and I thought it might be 'modules'. Sure enough, when I modified the file in its original location (no overrides), my new fields showed up on my site!

Now, one question for the zencart team. I noticed when I was in phpMyAdmin that if I removed the 'auto_increment' condition from products_id, it looked like I could then enter my own values for product id (I'd like this to be my sku's). Would this mess up other functions in zen if I did this? Would the answer depend on if the skus are integers vs. alphnumeric? That's all I wanted in the first place, was to use my skus as the id's.

Thanks, if any of you guys (zen team) are reading this!

6 Aug 2007, 2:27 PM
#27
elbasha avatar

elbasha

New Zenner

Join Date:
Aug 2007
Posts:
36
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

Yes I was in the table already, but I mean what is written by crazy is kind of confusing me, I don't know how to fill it, he has both the products he wants to add on one line, but we have to add each of them seperatly.

6 Aug 2007, 4:05 PM
#28
lismith avatar

lismith

New Zenner

Join Date:
May 2007
Posts:
78
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

magneteye:

hey, trying this out. but how do I create dropdowns and text areas? you only give examples of a text field.

I tried changing zen_set_field_length to zen_draw_textarea_field but it gave me errors.

I need mine as a text area too. Any help?

6 Aug 2007, 5:06 PM
#29
k4satin avatar

k4satin

New Zenner

Join Date:
Mar 2006
Location:
Sacramento, CA
Posts:
93
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

ElBasha:

Yes I was in the table already, but I mean what is written by crazy is kind of confusing me, I don't know how to fill it, he has both the products he wants to add on one line, but we have to add each of them seperatly.

The line that crazy_chris wrote, "ALTER..." is the SQL query itself. The menu that you found is an alternative to writing your own SQL queries for us SQL-illiterate folks. When you fill out the form and save your new field, phpMyAdmin creates the query for you, and it'll look like what crazy_chris wrote. You have to do it separately for each field. If you want to write in SQL query form instead, click on 'SQL' from the menu along the top. I think that if you're writing an SQL query you can include as many fields as you want at the same time.

6 Aug 2007, 5:24 PM
#30
k4satin avatar

k4satin

New Zenner

Join Date:
Mar 2006
Location:
Sacramento, CA
Posts:
93
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

lismith:

I need mine as a text area too. Any help?

I looked at what they did for the 'description' field (its in TABLE products_description) and they just put 'text' in the 'Type' field. Have you tried that?

As for the drop-downs, I'd suggest trying to duplicate what they did for manufacturers_id. It looks like there's a column there for 'distinct values'. I haven't done it, but I'd try that...

6 Aug 2007, 5:51 PM
#31
elbasha avatar

elbasha

New Zenner

Join Date:
Aug 2007
Posts:
36
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

k4satin:

The line that crazy_chris wrote, "ALTER..." is the SQL query itself. The menu that you found is an alternative to writing your own SQL queries for us SQL-illiterate folks. When you fill out the form and save your new field, phpMyAdmin creates the query for you, and it'll look like what crazy_chris wrote. You have to do it separately for each field. If you want to write in SQL query form instead, click on 'SQL' from the menu along the top. I think that if you're writing an SQL query you can include as many fields as you want at the same time.

Okay,
I went to SQL and I see this:

Run SQL query/queries on database phones:

In the blank where I can put what I want it says: SELECT * FROM products WHERE 1

Do I just erase that an paste: ALTER TABLE zencart_products ADD product_condition INT NOT NULL , ADD products_warranty VARCHAR( 32 ) NOT NULL;

And press on GO?

6 Aug 2007, 6:14 PM
#32
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How-To: Add new Properties to your Products

Are you using prefixes on your database tables?

The default line you show reads products but what you say you want to add is reading zencart_products ... :unsure:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

6 Aug 2007, 7:54 PM
#33
elbasha avatar

elbasha

New Zenner

Join Date:
Aug 2007
Posts:
36
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

Ajeh:

Are you using prefixes on your database tables?

The default line you show reads products but what you say you want to add is reading zencart_products ... :unsure:

Well I just copied and pasted what crazy had and changed the two things to what I want them to be. He had zencart_products in there. So what did I do wrong?

6 Aug 2007, 9:21 PM
#34
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How-To: Add new Properties to your Products

If the products table in your database is NOT called:
zencart_products

then you need to look and see what it is called ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

6 Aug 2007, 9:42 PM
#35
k4satin avatar

k4satin

New Zenner

Join Date:
Mar 2006
Location:
Sacramento, CA
Posts:
93
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

Ajeh,

Glad to see you've joined us in this thread! We could use someone a little more knowledgeable.

Would I mess everything up if I asigned my sku numbers as my product id's instead of using the auto-increment feature for 'products_id'? My sku numbers are alph-numeric.

6 Aug 2007, 9:48 PM
#36
elbasha avatar

elbasha

New Zenner

Join Date:
Aug 2007
Posts:
36
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

Ajeh:

If the products table in your database is NOT called:
zencart_products

then you need to look and see what it is called ...

Okay, I don't see zencart_products anywhere. I see just products and after that it has like products_image, _weight, etc. What should I do?

P.S. Could you please also reply to my other post: http://www.zen-cart.com/forum/showthread.php?p=414027#post414027

Thanks.

6 Aug 2007, 10:04 PM
#37
k4satin avatar

k4satin

New Zenner

Join Date:
Mar 2006
Location:
Sacramento, CA
Posts:
93
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

I think what you'd want would go more like this:

ALTER TABLE products ADD products_condition INT NOT NULL , ADD products_warranty VARCHAR( 32 ) NOT NULL;

You might also want to edit INT and VARCHAR. INT means integer - you'd probably want VARCHAR for your product_condition, and you can set the length of the input field in the perentheses. For products_warranty, you might use INT, if it's just going to be a number...

6 Aug 2007, 10:48 PM
#38
elbasha avatar

elbasha

New Zenner

Join Date:
Aug 2007
Posts:
36
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

k4satin:

I think what you'd want would go more like this:

ALTER TABLE products ADD products_condition INT NOT NULL , ADD products_warranty VARCHAR( 32 ) NOT NULL;

You might also want to edit INT and VARCHAR. INT means integer - you'd probably want VARCHAR for your product_condition, and you can set the length of the input field in the perentheses. For products_warranty, you might use INT, if it's just going to be a number...

Okay, do I need to put it where I thought I woud?

I went to SQL and I see this:

Run SQL query/queries on database phones:

In the blank where I can put what I want it says: SELECT * FROM products WHERE 1

7 Aug 2007, 12:15 AM
#39
k4satin avatar

k4satin

New Zenner

Join Date:
Mar 2006
Location:
Sacramento, CA
Posts:
93
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

ElBasha:

Okay, do I need to put it where I thought I woud?

I went to SQL and I see this:

Run SQL query/queries on database phones:

In the blank where I can put what I want it says: SELECT * FROM products WHERE 1

Just delete whatever's there and add your statement ('ALTER TABLE...) I think the other stuff is there to help you create an SQL statement, but not for what you're trying to do.

7 Aug 2007, 12:22 AM
#40
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How-To: Add new Properties to your Products

k4satin:

Would I mess everything up if I asigned my sku numbers as my product id's instead of using the auto-increment feature for 'products_id'? My sku numbers are alph-numeric.

The products_id is a control feature of Zen Cart and all of the code addresses this ...

You do not want to alter this field nor manipulate it in any way ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!