Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2008
    Posts
    5
    Plugin Contributions
    0

    red flag !! Please help !! Add new Properties to your Products

    Hi, Im new here so hello everyone. Im also new to zen cart and web development so excuse me for maybe asking stupid questions.

    I need to add new properties to my catalog, for example manufacturer and manufactures code.

    I folowed this thread http://www.zen-cart.com/forum/showthread.php?t=57924 and from what I can understand, its not advisable to edit/modify the main zen cart tables, but to rather use new tables.

    I am sure there are many people who would really like to be able to implement this feature.

    As per pensive612's request, could anyone please provide the following info as I could not really follow the other thread. (maybe it got hijacked and I lost the plot )

    Quote Originally Posted by pensive612 View Post
    Thanks Chris! it worked perfect for me.

    If you have a chance to respond,

    Do you have any thoughts on:

    separate tables instead,

    easy populate,

    and having these new fields included in the search fields!!

    just a wishlist.

    thanks again for your time in that step-by-step

    Any help would be highly appreciated.


    Original post by crazy_chris:

    Quote Originally Posted by crazy_chris View Post
    hi folks,

    this is a little howto add new properties to general products
    (like guarantee time, color, oem-number, compatible models, whatsoever)
    1. think
      decide which new properties you want to add to your products
      (in this example we take guarantee-time (in months) and color)
      .
    2. db manipulation
      open the table "products" in your zencart-database and insert new rows at the end of the table called "products_guarantee" and "products_color"
      ALTER TABLE `zencart_products` ADD `products_guarantee` INT NOT NULL , ADD `products_color` VARCHAR( 32 ) NOT NULL;
      .
    3. edit 'collect_info.php' (in /admin/includes/modules/product/)
      1. at the very beginning there is the variable $parameters set. add your row-names to the end:
        'products_guarantee' => '0', 'products_color' => '' );
        .
      2. just below there is the db-query set [$product = $db->Execute("...]
        add your rows with a 'p.' in front (before the "from ..." part)
        select ......., p.products_guarantee, p.products_color from ....
        .
      3. now you can add the input fields in the product-mask (lets say somewhere around line 450 or so):
        <tr>
        <td class="main">Guarantee Time (in months)</td>
        <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_input_field('products_guarantee', $pInfo->products_guarantee, zen_set_field_length(TABLE_PRODUCTS, 'products_guarantee')); ?></td>
        </tr><tr>
        <td class="main">Color</td>
        <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_input_field('products_color', $pInfo->products_color, zen_set_field_length(TABLE_PRODUCTS, 'products_color')); ?></td>
        </tr>
        .
    4. edit 'preview_info.php' (in /admin/includes/modules/product/)
      somewhere around line 10 is the variable $product set. like in step 3.2 add the new rows with a 'p.' in front just before the 'from'
      select ......., p.products_guarantee, p.products_color from ....
      .
    5. finally, edit 'update_product.php' (in /admin/includes/modules/)
      around line 20 is the $sql_data_array set. add to the last lines before ');' the new rownames.
      $sql_data_array = .......... 'products_guarantee' => zen_db_prepare_input($_POST['products_guarantee']), 'products_color' => zen_db_prepare_input($_POST['products_color']) );
      .
    6. Setup All Done!
      .

      .
      .
      .
      Of course, now we want to display our cool new properties .
      .
    7. edit 'main_template_vars.php' (in /includes/modules/pages/product_info/)
      around line 46 you find the variable $sql set. like in step 3.2 add the new rows with a 'p.' in front just before the 'from'
      select ......., p.products_guarantee, p.products_color from ....
      .
    8. last step: display the new infos
      edit 'tpl_product_info_display.php'
      (in /includes/templates/template_default/templates/)
      now, wherever you want, you can add to the html:
      <?php echo $product_info->fields['products_guarantee']; ?> and <?php echo $product_info->fields['products_color']; ?>

    enjoy!


    ps: now i'm feeling really ############ up : P




    written by chris at linuxuser.at

  2. #2
    Join Date
    Feb 2008
    Posts
    5
    Plugin Contributions
    0

    Default Re: !! Please help !! Add new Properties to your Products

    Anyone ???

  3. #3
    Join Date
    Feb 2008
    Posts
    1,352
    Plugin Contributions
    1

    Default Re: !! Please help !! Add new Properties to your Products

    Did you try the options under configuration> product listing.
    You can show your manufacture and other info if you set the option to 1 instead of 0.

    Or are you talking about something else????

  4. #4
    Join Date
    Feb 2008
    Posts
    5
    Plugin Contributions
    0

    Default Re: !! Please help !! Add new Properties to your Products

    I have v_manufacturers_name in my products database. I would like to add more information about the manufacturer for example:
    Manufacturer Division
    Manufacturer Description
    Manufacturer Product Code (This is different from my product code and is needed for reference)

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,474
    Plugin Contributions
    6

    Default Re: !! Please help !! Add new Properties to your Products

    There already is a manufacturers_id in the products table that ties the products table to the manufacturers table ...

    You could just add the additional fields to the manufacturers table and gather them when the rest of the manufacturers information is gathered ...

    Or, are these new fields as unique as the products are?
    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: v1.5.5]
    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!

 

 

Similar Threads

  1. How-To: Add new Properties to your Products
    By crazy_chris in forum Setting Up Categories, Products, Attributes
    Replies: 271
    Last Post: 8 Sep 2017, 04:08 AM
  2. shopping cart contents and new properties to the products
    By stitchnkitty in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 10 Nov 2009, 05:50 PM
  3. Replies: 4
    Last Post: 20 Jun 2009, 04:06 PM
  4. i need your help please new here
    By cathshandcrafts in forum General Questions
    Replies: 3
    Last Post: 18 Aug 2008, 05:48 PM
  5. alter and add new product properties
    By jmitton in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 20 Jan 2008, 03:24 PM

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