New database field in products listing

michal.rimal <[email protected]> 13 Sep 2003 08:33:19 -0000
Newsgroups gmane.comp.web.oscommerce.installation
Message-ID <b2fe8fbf4477e856b3cb5d9c622b41b6@osCommerce-Forums>
This message was sent from: Installation and Configuration
http://forums.oscommerce.com/viewtopic.php?p=228810#228810
----------------------------------------------------------------

Hi,

I have added a new database field (called products_writer - it is in table products). Now I need to display the value of this field in products listing, but not in new column. I need to display it under the products name (second line - I mean a line under products name). I have find questions and answers how to add new column. I tried it and it works but I have no idea how to display it under products name (not as new column).

I have tried to modify the product_listing.php ... here is the original part of this file:

[code]case 'PRODUCT_LIST_NAME': 
            $lc_align = ''; 
            if (isset($HTTP_GET_VARS['manufacturers_id'])) { 
              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>'; 
            } else { 
              $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>&nbsp;'; 
            } 
            break;[/code]

and here is the same part after my modifications:

[code]case 'PRODUCT_LIST_NAME': 
            $lc_align = ''; 
            if (isset($HTTP_GET_VARS['manufacturers_id'])) { 
              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '<br>' . $listing['products_writer'] . '</a>'; 
            } else { 
              $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '<br>' . $listing['products_writer'] . '</a>'; 
            } 
            break;[/code]

But this does not work. Please help me.

Thank you