Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2005
    Posts
    8
    Plugin Contributions
    0

    Default Additional product data fields

    I am fairly new to Zen Cart, but I really like it so far.

    I almost always need additional data fields for my projects, and I have designing on page the basics of an 'additional product fields' module. I would like some feedback on the design.

    One thought is to have a simple table like:

    product_additional_fields
    - field_name varchar(100)
    - field_description varchar(100)

    product_additional_field_values
    - product_id
    - field_name varchar(100)
    - field value varchar(200) OR text

    The admin tools would let the admin add new fields with a description, then the modules would create basic text fields for these on the 'add product' screen.

    The main drawback is that everything is stored as plain text, so you can't really do anything true comparisons or reports. Also, the SQL to get the fields for each product in the product listing is a little bit of a pain, probably easiest to most of the work in PHP.

    Another thought is to create a more complex set up, starting with an empty table, and allow the admin user to add fields, choose between text, integer, numberic, and then have the admin module create the necessary 'alter table ' syntax to create the data fields in the additional fields table. Then, the product data would be stored in this table, one row per product. A simple left join in the product listing or product details would pull in the data if it exists.

    Can someone that is more familiar with Zen give me some guidance. I think this would be a useful module if built properly.

    Also, I don't see anything in the development map, so maybe this is in the works.
    Thanks,
    B

  2. #2
    Join Date
    Dec 2004
    Location
    New York, USA
    Posts
    1,198
    Plugin Contributions
    0

    Default Re: Additional product data fields

    You can create custom 'Product Type' that would be in keeping with Zen Cart's core design. (Falls in line with Admin->Catalog->Product Types.) This allows you to add customized fields for your needs and not have to hack apart ZC. There are some available in the downloads section that could help you in understanding the structure and from there you could further tweak.

    Products Types - Downloads (current)
    Products Types - Downloads (older archived)

    There are a lot of discussions regarding this subject on the ZC forum. Just search around. I think it's what you are trying to do.

  3. #3
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default Re: Additional product data fields

    I almost always need additional data fields for my projects, and I have designing on page the basics of an 'additional product fields' module. I would like some feedback on the design.

    One thought is to have a simple table like:

    product_additional_fields
    - field_name varchar(100)
    - field_description varchar(100)
    In the mean time, you can always download my version of this contribution from the : All other contributions section of the forum.

 

 

Similar Threads

  1. Additional Product Fields
    By Kamino84 in forum Customization from the Admin
    Replies: 9
    Last Post: 16 Jun 2011, 08:40 PM
  2. Additional Product Fields
    By schwarzes in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 8 Aug 2010, 07:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg