Page 3 of 16 FirstFirst 1234513 ... LastLast
Results 21 to 30 of 159
  1. #21
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,296
    Plugin Contributions
    22

    Default Re: How To Add New Product Fields?

    All of your products must exist in the new database table. If you had existing products, you must add them to the new table. from the readme file:

    If you are installing this into a cart that already has products, you will have to populate the new table with every product id in order for the products to be visible. This is not hard to do with excel and phpmyadmin. If you have access to your database, export the file to excel, add the fields and import it back in.
    The full-time Zen Cart Guru. WizTech4ZC.com

  2. #22
    Join Date
    May 2009
    Location
    Virginia
    Posts
    101
    Plugin Contributions
    0

    Default Re: How To Add New Product Fields?

    All of my product pages are screwed up now. I think I'm going to revert back to the default and try Delia's download. I just want an extra text field for a heading is all.

  3. #23
    Join Date
    May 2009
    Location
    Virginia
    Posts
    101
    Plugin Contributions
    0

    Default Re: How To Add New Product Fields?

    Quote Originally Posted by delia View Post
    All of your products must exist in the new database table. If you had existing products, you must add them to the new table. from the readme file:

    If you are installing this into a cart that already has products, you will have to populate the new table with every product id in order for the products to be visible. This is not hard to do with excel and phpmyadmin. If you have access to your database, export the file to excel, add the fields and import it back in.
    Can you be more specific? Or rather, is there a way to start from the beginning?

  4. #24
    Join Date
    May 2009
    Location
    Virginia
    Posts
    101
    Plugin Contributions
    0

    Default Re: How To Add New Product Fields?

    Quote Originally Posted by delia View Post
    All of your products must exist in the new database table. If you had existing products, you must add them to the new table. from the readme file:
    Does the information from the table products_description also go in the new database table? I got the field to show up in my admin to fill out, but all of my product pages are blank. Thank you for explaining the above. I'm starting to understand better now!

  5. #25
    Join Date
    Jun 2009
    Location
    Brisbane, QLD AUS
    Posts
    210
    Plugin Contributions
    0

    Default Re: How To Add New Product Fields?

    easypopulate modifications went pretty smoothly for me, however i didn't 'futureproof' for upgrades as outlined earlier in this thread. i simply added "xxxx_id" fields to the products table, and created additional tables without a product_id index (same as manufacturer) so i guess i'll have to dump these tables and the products table data to file before upgrading. silly me!

    as far as modifying easypopulate is concerned, i just modified each of the easypopulate files (you can search for them using the developers toolkit in the admin section) to include:

    a) the new field variables, names and rules for the import file
    b) the sql to insert the additional column data (obviously matching it up with what i changed in mysql)

    this was pretty simple for me because i simply copied every reference to 'manufacturer' and changed to suit, however because i did not follow the method used here there will be some minor changes to sql etc. that you may need to be wary of.

    andrejs

  6. #26
    Join Date
    Apr 2009
    Posts
    9
    Plugin Contributions
    0

    Default Re: How To Add New Product Fields?

    hi, i followed your directions and almost everything seems to be working great. Thank you for posting this info. I followed everything from your first post and now I have a field added and when I add a new product, the database updates appropriately for my new table and fields.

    The problem I an running into is that the product page doesn't pull the new information from these fields into the page. It's there in the database, it's just that it doesn't pull into the page. The products_id's all match up and I can view it in phpMyAdmin. Even when I remove the php IF statement from the tpl_product_info_display.php page, to force anything to display, the field from the database doesn't show up, only the hard-coded text before that field.

    Does anyone have any pointers on why this might be happening?

    Thanks in advance for any help!

  7. #27
    Join Date
    Apr 2009
    Posts
    9
    Plugin Contributions
    0

    Default Re: How To Add New Product Fields?

    Never mind the last post. I figured out the problem, I just made a small syntax error in the main_template_vars.php file.

    Great thread though.

  8. #28
    Join Date
    Nov 2005
    Posts
    86
    Plugin Contributions
    1

    Default Re: How To Add New Product Fields?

    thanks webego for putting this little guide together and all the others who contributed, its helped me a lot, but I'm stuck, 6 hours and lots of coffee and I'm missing something but I can't figure out what.

    I started with a single extra field as in the guide, that worked so I added a second field, that worked so I added 20 fields but thats broken it.

    It works fine on the public side, I've populate via phpmyadmin and it shows on the product page, so I've ruled out a database error.

    But when it come to adding or amending a product it fails with the error

    1054 Unknown column 'year_1985' in 'field list'
    in:
    [insert into products_extra_stuff (products_maker, products_ex_model, year_1985, year_1986, year_1987,.....
    this happens from the product preview page, when I hit the update button, I can see the new field variables on the product preview page (putting in a php echo) so it seem the problem is on the update_product.php page.

    here the added code for that page

    ////////////// MY ADDED FIELDS ////////////////////
    $sql_data_array = array('products_maker' => zen_db_prepare_input($_POST['products_maker']),
    'products_ex_model' => zen_db_prepare_input($_POST['products_ex_model']),
    'year_1985' => zen_db_prepare_input($_POST['year_1985']),
    'year_1986' => zen_db_prepare_input($_POST['year_1986']),
    'year_1987' => zen_db_prepare_input($_POST['year_1987']),
    'year_1988' => zen_db_prepare_input($_POST['year_1988']),
    'year_1989' => zen_db_prepare_input($_POST['year_1989']),
    'year_1990' => zen_db_prepare_input($_POST['year_1990']),
    'year_1991' => zen_db_prepare_input($_POST['year_1991']),
    'year_1992' => zen_db_prepare_input($_POST['year_1992']),
    'year_1993' => zen_db_prepare_input($_POST['year_1993']),
    'year_1994' => zen_db_prepare_input($_POST['year_1994']),
    'year_1995' => zen_db_prepare_input($_POST['year_1995']),
    'year_1996' => zen_db_prepare_input($_POST['year_1996']),
    'year_1997' => zen_db_prepare_input($_POST['year_1997']),
    'year_1998' => zen_db_prepare_input($_POST['year_1998']),
    'year_1999' => zen_db_prepare_input($_POST['year_1999']),
    'year_2000' => zen_db_prepare_input($_POST['year_2000']),
    'year_2001' => zen_db_prepare_input($_POST['year_2001']),
    'year_2002' => zen_db_prepare_input($_POST['year_2002']),
    'year_2003' => zen_db_prepare_input($_POST['year_2003']),
    'year_2004' => zen_db_prepare_input($_POST['year_2004']),
    'year_2005' => zen_db_prepare_input($_POST['year_2005']),
    'year_2006' => zen_db_prepare_input($_POST['year_2006']),
    'year_2007' => zen_db_prepare_input($_POST['year_2007']),
    'year_2008' => zen_db_prepare_input($_POST['year_2008']),
    'year_2009' => zen_db_prepare_input($_POST['year_2009']),
    'year_2010' => zen_db_prepare_input($_POST['year_2010']),
    'year_2011' => zen_db_prepare_input($_POST['year_2011']),
    'year_2012' => zen_db_prepare_input($_POST['year_2012']),
    'year_2013' => zen_db_prepare_input($_POST['year_2013']),
    'year_2014' => zen_db_prepare_input($_POST['year_2014']),
    'year_all' => zen_db_prepare_input($_POST['year_all'])


    );

    if ($action == 'insert_product') {
    $insert_sql_data = array('products_id' => $products_id);

    $sql_data_array = array_merge($sql_data_array, $insert_sql_data);

    zen_db_perform('products_extra_stuff', $sql_data_array);
    } elseif ($action == 'update_product') {
    zen_db_perform('products_extra_stuff', $sql_data_array, 'update', "products_id = '" . (int)$products_id . "'");
    }
    /////////////////////////////////////////////
    can anyone advise me what I've missed.
    thanks

  9. #29
    Join Date
    Jun 2007
    Posts
    7
    Plugin Contributions
    0

    Default Re: How To Add New Product Fields?

    Hi

    I added 13 fields and everything worked fine.

    When I deleted a product, it did not delete the record in the new table.

    Can somebody give me the code for deletion too?

    Thanks

  10. #30
    Join Date
    Jul 2009
    Posts
    14
    Plugin Contributions
    1

    help question Re: How To Add New Product Fields?

    That's an excellent question, so I'm just bumping this. Anyone want to tackle making sure the products from the new table are deleted when they're deleted from the products table?

    Great thread!

 

 
Page 3 of 16 FirstFirst 1234513 ... LastLast

Similar Threads

  1. How to add new fields?
    By chandroo007 in forum Upgrading from 1.3.x to 1.3.9
    Replies: 1
    Last Post: 1 Jun 2010, 03:13 PM
  2. How To Add New Fields to Invoice?
    By PudzPud in forum Basic Configuration
    Replies: 7
    Last Post: 15 Nov 2009, 03:50 PM
  3. Replies: 1
    Last Post: 10 Dec 2007, 02:40 PM
  4. How to add labels to new fields
    By kappaluppa in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 3 Feb 2007, 07:16 PM
  5. How i can add new data fields to a Product
    By shreesoft in forum Customization from the Admin
    Replies: 4
    Last Post: 2 Oct 2006, 03:10 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR