Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20
  1. #11
    Join Date
    Mar 2011
    Location
    Ireland
    Posts
    286
    Plugin Contributions
    0

    Default Re: adding custom fields for products

    Quote Originally Posted by kamion View Post
    It is not easy at first, but it can be done. :) Unfortunately, you have to give a lot more detailed information than your original post if you want some sensible help, other than words of encouragement.
    i have added 2 fields (decimal & numeric) to the database and amended a no of scripts to reflect the inclusion of the two fields this as advised in some of the forums namely:

    admin/includes/modules/products/collect_info.php
    admin/includes/modules/products/preview_info.php
    admin/includes/languages/english/product.php
    admin/includes/modules/update_product.php
    /includes/modules/pages/product_info/main_template_vars.php
    admin/includes/modules/category_product_listing.php
    /public_html/shop/zencart/includes/templates/template_default/templates/tpl_product_info_display.php

    but nothing seems to work.
    e.g. collect_info.php

    <td class="main"><?php echo TEXT_PRODUCTS_COUNT; ?></td>
    <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_input_field('products_count', ($pInfo->products_count== 0 ? 1 : $pInfo->products_count)); ?></td>

    /templates/tpl_product_info_display.php

    <?php echo (($flag_show_product_info_count ==1 and $products_count !=0) ? '<li> . TEXT_PRODUCTS_COUNT . $products_count . '<li>' : '') . "\n"; ?>

    i dont think the above is correct.

    any ideas!!

  2. #12
    Join Date
    Apr 2008
    Location
    Athlone, Ireland
    Posts
    176
    Plugin Contributions
    5

    Default Re: adding custom fields for products

    This is how I have it in collect_into.php
    Code:
    <td class="main">Count: </td>
    <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_input_field('products_count', $pInfo->products_count, zen_set_field_length (TABLE_PRODUCTS, 'products_count')); ?></td>
    </tr>
    and in tpl_product_info_display.php
    Code:
    <div id="productDescription" class="productGeneral biggerText"><strong>Count: </strong><?php echo $product_info->fields['products_count']; ?></div>

  3. #13
    Join Date
    Mar 2011
    Location
    Ireland
    Posts
    286
    Plugin Contributions
    0

    Default Re: adding custom fields for products

    Quote Originally Posted by dropbop View Post
    This is how I have it in collect_into.php
    Code:
    <td class="main">Count: </td>
    <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_input_field('products_count', $pInfo->products_count, zen_set_field_length (TABLE_PRODUCTS, 'products_count')); ?></td>
    </tr>
    and in tpl_product_info_display.php
    Code:
    <div id="productDescription" class="productGeneral biggerText"><strong>Count: </strong><?php echo $product_info->fields['products_count']; ?></div>
    thank you for trying this for me, i copied the code and inserted it but still not working. i'm thinking that may be its a series of errors on my part that is doing this. What you advised is slightly different to the others so perhaps the other files are inconsistent too. i would have thought that the ability to add fields to the products would be a major need for most, so i thought there would be more on this topic.

    I followed both advice from the following link and crazy chris but i think it contradicts as well.
    http://www.czetsuya-tech.###########...uct-admin.html

    Am I correct in assuming that when done correctly that when i go into add products the fields added should appear for data input.

    help, i'm getting the feeling i'm a way over my head here.

  4. #14
    Join Date
    Feb 2008
    Posts
    1,336
    Plugin Contributions
    1

  5. #15
    Join Date
    Mar 2011
    Location
    Ireland
    Posts
    286
    Plugin Contributions
    0

    Default Re: adding custom fields for products

    Quote Originally Posted by CoolCarPartsOnline View Post
    Thanks for sending this. silly question but to implement this do you just replace the files into the sub-directories as named.

    This module seems to create another table, i only want to add two fields to the existing product table as they relate to the table in question.

  6. #16
    Join Date
    Feb 2008
    Posts
    1,336
    Plugin Contributions
    1

    Default Re: adding custom fields for products

    You would have to merge the changes only.

    DO NOT override any files as this was developed for 1.38 and some files have changed since then.

    It will not affect the functions of the mod though if you do merge the codes.

  7. #17
    Join Date
    Mar 2011
    Posts
    93
    Plugin Contributions
    0

    Default Re: adding custom fields for products

    Hi jagall,

    When you said nothing seems to work, what do you actually see when you try to add/edit the product in the Categoris/Products admin page?

    Do you see everything but the new field you added, or do you see a blank page, or do you see fields displayed but stops right where you added your own field?

    If you see everything but the new field, it could be you're editing the wrong file in the wrong place (override).

    If you see only a blank page, it could be a syntax error in your code - like an extra semicolon, or missing bracket, etc.

    If it displays correctly and stops where you added your own field, then something is wrong with that piece of code you added. :)

    Am I correct in assuming that when done correctly that when i go into add products the fields added should appear for data input.
    Yes. :)

    Just refer to existing fields in collect_info.php file and search for all instances of the field name and then duplicate the bits except change the names to your own custom field name.

    I suggest search for products_quantity and try to duplicate (and renaming the duplicate) all instances of products_quantity in collect_info.php.

    This would then show up when you try to add a new product of that type.

    You then need to edit preview_info.php to preview the value you added.

    After that, edit update_product.php to actually save the value into the database.

    Each step can be done and tested one by one, so you don't have to worry about preview_info.php and update_product.php until you get collect_info.php displaying correctly.

    And forget about /templates/tpl_product_info_display.php for now. That's on the Catalog side and you can ignore it for now until you have at least got update_product.php working.
    Last edited by kamion; 7 Apr 2011 at 04:18 AM.

  8. #18
    Join Date
    Mar 2011
    Location
    Ireland
    Posts
    286
    Plugin Contributions
    0

    Default Re: adding custom fields for products

    Hi thanks to all who responded to my pleas, and you will be glad to know my problem is fixed
    big thanks to dropbop for this one.
    i had not assigned the product type 'General' correctly, and few commas had gone astray i know, i know, i feel stupid now . . . but what a relief

  9. #19
    Join Date
    Apr 2008
    Location
    Athlone, Ireland
    Posts
    176
    Plugin Contributions
    5

    Default Re: adding custom fields for products

    No problem at all jagall :)

    Glad to help.

  10. #20
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,732
    Plugin Contributions
    27

    bug Re: adding custom fields for products

    Product description add to admin or short description module

    Bug fix in the 'short description' module located here:
    http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=271

    in admin/includes/modules/product/preview_info.php
    look for:
    $pInfo->products_short_desc = zen_get_products_ahort_desc($pInfo->products_id, $languages[$i]['id']);

    replace with:
    $pInfo->products_short_desc = zen_get_products_short_desc($pInfo->products_id, $languages[$i]['id']);

    i'll post more once i get this module working for 1.3.9h.


    Twitch.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v155 How to Add Custom Fields for Materials & Dimensions when adding products?
    By wmorris in forum All Other Contributions/Addons
    Replies: 95
    Last Post: 27 Jul 2016, 08:36 AM
  2. Creating Custom Fields for Products based on Category
    By Kma1819 in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 12 Feb 2008, 11:51 AM
  3. Adding required fields for specific products
    By Capp-Ware in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 23 Aug 2007, 06:54 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