Page 16 of 24 FirstFirst ... 61415161718 ... LastLast
Results 151 to 160 of 234
  1. #151
    Join Date
    Oct 2008
    Posts
    36
    Plugin Contributions
    0

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

    I have posted a mix of the OP solution on this thread and the one by zskiman (mid thread) plus my own additions which allows the creation of new product fields, held in a separate table and declared so they can be inserted into the page in the same manner as existing fields.

    http://www.zen-cart.com/forum/showthread.php?t=120523

    Hopefully of use to someone.

    G

  2. #152
    Join Date
    May 2007
    Posts
    39
    Plugin Contributions
    0

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

    Does anybody know how to add an additional IMAGE field to the product table?

    I need this to display a special image at a place other than main image or additional images.

    I managed to add various fields which all show up fine both in admin and catalog but the newly created image field isn't shown nor is the file-name in the database as it should be. I simply copied some parts from the main image for this new image field. It is displayed on the preview_info.php but gets lost on its way to be stored.

    Can someone give a hint on this issue? Thanks in advance!

  3. #153

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

    I've added without problems many new fileds in my products page like this:

    hhttp://www.dvdmart.it/shop/007-il-m...a-p-91410.html

    now i'm trying to add many of these fiels in products_all listing, featured, new etc.

    my work:

    includes/modules/product_listing.php

    near line 30:

    case 'PRODUCT_LIST_NAME':
    $lc_text = TABLE_HEADING_PRODUCTS;
    $lc_align = '';
    $zc_col_count_description++;
    break;

    case 'PRODUCT_LIST_MYFIELD':
    $lc_text = TABLE_HEADING_MYFIELD;
    $lc_align = '';
    $zc_col_count_description++;
    break;

    near line 100:

    case 'PRODUCT_LIST_MODEL':
    $lc_align = '';
    $lc_text = $listing->fields['products_model'];
    break;

    case 'PRODUCT_LIST_MYFIELD':
    $lc_align = '';
    $lc_text = $listing->fields['products_myfieldsqlname'];
    break;

    includes/modules/pages/index/main_template_vars.php

    near line 136:

    // create column list
    $define_list = array(
    'PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
    'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
    'PRODUCT_LIST_MYFIELD' => PRODUCT_LIST_MYFIELD,

    near line 163:


    switch ($column_list[$i])
    {
    case 'PRODUCT_LIST_MODEL':
    $select_column_list .= 'p.products_model, ';
    break;
    case 'PRODUCT_LIST_MYFIELD':
    $select_column_list .= 'products_myfieldsqlname, ';
    break;

    includes/index_filters/default_filter.php

    near line 28, 43, 58, 73:

    $listing_sql = "select " . $select_column_list . " p.products_id, p.products_myfieldsqlname,

    near line 117:

    case 'PRODUCT_LIST_NAME':
    $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
    break;
    case 'PRODUCT_LIST_MANUFACTURER':
    $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;
    case 'PRODUCT_LIST_MYFIELD':
    $listing_sql .= "p.products_myfieldsqlname" . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;

    near line 122:

    case 'PRODUCT_LIST_MANUFACTURER':
    $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;
    case 'PRODUCT_LIST_MYFIELD':
    $listing_sql .= "p.products_myfieldsqlname" . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;

    includes/modules/template/MYTEMPLATE/template/tpl_modules_products_all_listing.php

    near line 42:

    if (PRODUCT_ALL_LIST_MODEL != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'model')) {
    $display_products_model = '<b>' . TEXT_PRODUCTS_MODEL . '</b>' . $products_all->fields['products_model'] . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_MODEL, 3, 1));
    } else {
    $display_products_model = '';
    }
    if (PRODUCT_ALL_LIST_MYFIELD != '0' and zen_get_show_product_switch($products_all->fields['products_myfieldsqlname'], 'myfield')) {
    $display_products_myfield = '<b>' . TEXT_PRODUCTS_MYFIELD . '</b>' . $products_all->fields['products_myfieldsqlname'] . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_MYFIELD, 3, 1));
    } else {
    $display_products_myfield = '';
    }

    near line 141:

    if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_MYFIELD') {
    echo $display_products_model;
    }
    if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_MYFIELD') {
    echo $display_products_myfield;
    }
    near line 177:

    if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_MODEL') {
    echo $display_products_model;
    }
    if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_MYFIELD') {
    echo $display_products_myfield;
    }

    includes/languages/MYTEMPLATE/english etc

    define('TEXT_PRODUCTS_MYFIELD', 'My extra products field');


    in my database i've added:

    INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (1200, 'Show my myfield', 'PRODUCT_ALL_LIST_MYFIELD', '2506', 'bla bla bla', 21, 13, NULL, '2006-07-05 13:59:40', NULL, NULL);


    Nothing appear here:

    http://www.dvdmart.it/shop/products_all.html

    whats wrong?
    Thanks!
    Last edited by gamesmart; 3 Aug 2009 at 05:54 PM.

  4. #154

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

    i can't modify my last post, on

    near line 141:

    if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_MYFIELD') {
    echo $display_products_model;
    }
    if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_MYFIELD') {
    echo $display_products_myfield;
    }

    right is

    near line 141:

    if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_MODEL') {
    echo $display_products_model;
    }
    if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_MYFIELD') {
    echo $display_products_myfield;
    }



    thanks!

  5. #155

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

    Resolved, ALONE.

  6. #156
    Join Date
    Nov 2007
    Posts
    30
    Plugin Contributions
    0

    Default Errors with this how-to

    I tried using this but didn't get the desired results. On further delving I believe the original how-to is mistaken, and I'm not sure why it works for so many others.

    I'm not a professional coder but I was able to fix it by replicating the way products_weight is handled. (I am adding height, length and width properties.)

    I'm not sure if all the following additions are necessary, but they worked for me. The main problem is that copy_to_confirm.php was not modified in this how-to. All additions based on a property product_height.

    1) update_product.php (in /admin/includes/modules/)
    a) around line 30, ADD:
    Code:
        $tmp_value = zen_db_prepare_input($_POST['products_height']);
        $products_height = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
    b) around line 40 ($sql_data_array = ....), ADD:
    Code:
    'products_height' => $products_height,
    2) copy_to_confirm.php (in /admin/includes/modules/)
    a) around line 37 ($product = $db->Execute...) ADD:
    Code:
    , products_height
    b) around line 52 ADD:
    Code:
                $tmp_value = zen_db_input($product->fields['products_height']);
                $products_height = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
    c) around line 62 ($db->Execute("insert into " . TABLE_PRODUCTS . "....) ADD:
    Code:
    , products_height
    d) around line 79 (continuation of last statement) ADD
    Code:
                                      '" . $products_height . "',
    I'm pretty sure these last two need to have the fields in the correct order that they appear in the table.

    OK! Now I can enter the new properties and they actually get entered into the database!!!

  7. #157
    Join Date
    Oct 2008
    Posts
    36
    Plugin Contributions
    0

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

    Hi shen,

    I have made a modified version of the steps from this thread here which has worked for many. Note I have also added a bit here to ensure the extra product data is deleted when deleting a product.

    G

  8. #158
    Join Date
    May 2009
    Location
    Junction City, Oregon
    Posts
    317
    Plugin Contributions
    0

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

    I installed a new text field and got it right the first time. Woo Hoo!

    One trivial question... on the admin side, when I fill out the information, my new text field shows up at the bottom of my product listing page. Where do I need to go to move it up, right under my title?

    I already moved it up on my product info page that people can see, but on the admin side it would be nice to have the subtitle field I just created go directly under the title field.

    Thanks!

    KD

  9. #159

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

    Hi
    Look at the 1 page of this post it will be in
    edit 'collect_info.php' (in /admin/includes/modules/product/),
    edit 'preview_info.php' (in /admin/includes/modules/product/) or
    edit 'update_product.php' (in /admin/includes/modules/)
    don't remember now.

  10. #160
    Join Date
    May 2009
    Location
    Junction City, Oregon
    Posts
    317
    Plugin Contributions
    0

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

    It doesn't say specifically which file controls where the text field appears on the admin side when filling out product details. With 3 different files and 5-6 different edits, I don't want to mess this up before I start. Anyone else have an idea of which file it would be, and where I would look to re-order the fields?

    Thanks,

    KD

 

 
Page 16 of 24 FirstFirst ... 61415161718 ... LastLast

Similar Threads

  1. Add Space in Products
    By Lenora in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 27 Nov 2006, 05:01 PM
  2. Add products using CSS
    By Joné in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 14 Jul 2006, 08:50 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
  •