Arnoud Posted July 27, 2004 Share Posted July 27, 2004 Hello everybody I have installed the contribution Product extra fields It works great, but I can't let the extra fields show in the product_list. Does anyone realised this with succes? Can anyone help me on the right way? Thanks a lot --------------- Arnoud Quote Link to comment Share on other sites More sharing options...
osCshop Posted December 19, 2005 Share Posted December 19, 2005 Not sure if Arnoud is still looking for the answer but I am! Actually I want to display the data of a few fields from PEF not the field name. Instead of "Sort: Paperback | Year: 2005" I would like to show just "Paperback | 2005" in the productlisting. I think many people would like to display this information in the productlisting! Help is welcome... Quote Link to comment Share on other sites More sharing options...
Guest Posted February 25, 2006 Share Posted February 25, 2006 Not sure if Arnoud is still looking for the answer but I am!Actually I want to display the data of a few fields from PEF not the field name. Instead of "Sort: Paperback | Year: 2005" I would like to show just "Paperback | 2005" in the productlisting. I think many people would like to display this information in the productlisting! Help is welcome... After I installed this and had same problem I noticed red green dot in the extra fields manager in Admin clicked the green dot to switch them on and they now show in product listing although not where I want them to be. Does your search work ok Quote Link to comment Share on other sites More sharing options...
JuanIgnacio Posted July 28, 2007 Share Posted July 28, 2007 I have the fields in GREEN status, disabled STS but columns doesn´t show! Help please! Quote Link to comment Share on other sites More sharing options...
JuanIgnacio Posted July 28, 2007 Share Posted July 28, 2007 i got the attributes to appear in the product description but I want it to appear in the product listing also. Any ideas on how I do that? Quote Link to comment Share on other sites More sharing options...
ceetah Posted January 27, 2008 Share Posted January 27, 2008 i got the attributes to appear in the product description but I want it to appear in the product listing also.Any ideas on how I do that? hello can you please help and tell me how can I show the product extra fields in product listing? or at least which file do I have to edit? (is it he same product_info.php that appears in the list?) Quote Link to comment Share on other sites More sharing options...
hari_shyam Posted January 27, 2008 Share Posted January 27, 2008 hellocan you please help and tell me how can I show the product extra fields in product listing? or at least which file do I have to edit? (is it he same product_info.php that appears in the list?) for products listings you will have to edit the includes/modules/products_listings.php file. But also note that you will have appropriately change the query from wherever the product listing is called in.. or in the product listing check if the extra field is present and then only show up ( similar to the product info page code ). Hope that helped. Cheers Hari Quote Link to comment Share on other sites More sharing options...
ceetah Posted January 27, 2008 Share Posted January 27, 2008 for products listings you will have to edit the includes/modules/products_listings.php file. But also note that you will have appropriately change the query from wherever the product listing is called in.. or in the product listing check if the extra field is present and then only show up ( similar to the product info page code ). Hope that helped. Cheers Hari thank you very much! already did that and uploaded my little contribution there :D so check it out : Product Extra Fields in product listing Quote Link to comment Share on other sites More sharing options...
hari_shyam Posted January 27, 2008 Share Posted January 27, 2008 thank you very much! already did that and uploaded my little contribution there :Dso check it out : Product Extra Fields in product listing kwel !! :thumbsup: :thumbsup: Cheers, Hari Quote Link to comment Share on other sites More sharing options...
xavkick Posted January 28, 2008 Share Posted January 28, 2008 thank you very much! already did that and uploaded my little contribution there :Dso check it out : Product Extra Fields in product listing It seems you contribution is not working. Quote Link to comment Share on other sites More sharing options...
ceetah Posted February 10, 2008 Share Posted February 10, 2008 It seems you contribution is not working. yes I got a pm from someone saying id did not work it seems that I worked on another version of oscommerce.. RC1 I think (I also added the product extra features in my store manually.. ). So if someone has the latest version of oscommerce.. and a little knowledge of php... maybe can help us update exactly the files. (my contribution works if you know where to put the code fragments in the latest RC2 version.) Quote Link to comment Share on other sites More sharing options...
hari_shyam Posted February 10, 2008 Share Posted February 10, 2008 (edited) sorry posted on the wrong forum :(. Edited February 10, 2008 by hari_shyam Quote Link to comment Share on other sites More sharing options...
hari_shyam Posted February 10, 2008 Share Posted February 10, 2008 It seems you contribution is not working. can you please send the details as to where it fails.. for me it works very fine.. !! Hari Quote Link to comment Share on other sites More sharing options...
ceetah Posted February 10, 2008 Share Posted February 10, 2008 @xavkick What seems to be the problem? can you elaborate more? maybe me or Hari could help ! Quote Link to comment Share on other sites More sharing options...
xavkick Posted February 12, 2008 Share Posted February 12, 2008 @xavkick What seems to be the problem? can you elaborate more? maybe me or Hari could help ! The problem is that i use product_lisitng_col and i can not set it nice Quote Link to comment Share on other sites More sharing options...
i3r4dl4d Posted February 29, 2008 Share Posted February 29, 2008 it doesnt work because there places you instruct to place the code in the instructions dont exsist. i have an original unmodified product_listing.php file from OSC 2.2 so i know its not that thats wrong. if yours is from rc1 does anybody have an updated version they can post? Quote Link to comment Share on other sites More sharing options...
azresta Posted March 27, 2008 Share Posted March 27, 2008 It seems you contribution is not working. This will fix your headache, I also added it to the contribution page Enjoy includes/modules/product_listings.php FIND $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> '; } break; REPLACE WITH //PRODUCT EXTRA FIELDS IN PRODUCT LISTING - BEGINING //PRODUCT EXTRA FIELDS IN PRODUCT LISTING - BEGINING //$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . //$listing['products_name'] . '</a> '; // } // break; $extra_fields_text = ''; $extra_fields_query = tep_db_query(" SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef LEFT JOIN ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf ON ptf.products_extra_fields_id=pef.products_extra_fields_id WHERE ptf.products_id=". (int) $listing['products_id'] ." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."') ORDER BY products_extra_fields_order"); while ($extra_fields = tep_db_fetch_array($extra_fields_query)) { if (! $extra_fields['status']) continue; $extra_fields_text = $extra_fields_text. '<font color="#000000">'.$extra_fields['name'].': </font>' . '<font color="#006600">' .$extra_fields['value'].'<BR></font>'; } $lc_text = '<b><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $fldname . '</a></b> <br>' . $extra_fields_text . '<br>'; } break; // PRODUCT EXTRA FIELDS IN PRODUCT LISTING - END Quote Link to comment Share on other sites More sharing options...
kthull Posted April 12, 2008 Share Posted April 12, 2008 I'm new to the whole osC system and have a fresh install of 2.2 RC2a with only STS 4.5.8 added on. I've tried both the "Product Extra Fields in Product Listing Works with RC2.2" and the "STSv4.5.2_and_PRODUCT_EXTRA_FIELD" versions of PEF and can't seem to get it to show up in the cart admin. What am I doing wrong? Quote Link to comment Share on other sites More sharing options...
kthull Posted April 14, 2008 Share Posted April 14, 2008 I'm new to the whole osC system and have a fresh install of 2.2 RC2a with only STS 4.5.8 added on. I've tried both the "Product Extra Fields in Product Listing Works with RC2.2" and the "STSv4.5.2_and_PRODUCT_EXTRA_FIELD" versions of PEF and can't seem to get it to show up in the cart admin. What am I doing wrong? Ok, so I suppose installing an actual version of PEF might have been helpful in the first place. Sorry. :-" Quote Link to comment Share on other sites More sharing options...
xisto Posted April 27, 2008 Share Posted April 27, 2008 Can anyone please tell me how to display and extra field value in the invoice and packing slip? eg. I have various extra fields like author, isbn , publisher etc. and i want the author field to be displayed besides the product name in the invoice. Any help would be appreciated :rolleyes: Quote Link to comment Share on other sites More sharing options...
Guest Posted May 8, 2008 Share Posted May 8, 2008 :'( G'Day All, I've had a red hot go at installing this contrib but just can't make it happen. I'm getting this error 1054 - Unknown column 'pef.languages_id' in 'where clause' SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value FROM products_extra_fields pef LEFT JOIN products_to_products_extra_fields ptf ON ptf.products_extra_fields_id=pef.products_extra_fields_id WHERE ptf.products_id=33 and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='1') ORDER BY products_extra_fields_order [TEP STOP] We're running 2.2rc2a. Any help gladly received. Quote Link to comment Share on other sites More sharing options...
captainbohica Posted August 30, 2008 Share Posted August 30, 2008 hi... i was able to finally remove the PEF details from the product name in the product list.. HOWEVER, now in the product name column, it is duplicating the product picture... http://chargercards.com/index.php?cPath=21...ecb322f2b8955e4 here is my code in product_listing.php I must have duplicated the code somewhere.. please help! <?php /* $Id: product_listing.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id'); if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td> </tr> </table> <?php } $list_box_contents = array(); for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_text = TABLE_HEADING_MODEL; $lc_align = ''; break; case 'PRODUCT_LIST_NAME': $lc_text = TABLE_HEADING_PRODUCTS; $lc_align = ''; break; case 'PRODUCT_LIST_MANUFACTURER': $lc_text = TABLE_HEADING_MANUFACTURER; $lc_align = ''; break; case 'PRODUCT_LIST_PRICE': $lc_text = TABLE_HEADING_PRICE; $lc_align = 'right'; break; case 'PRODUCT_LIST_QUANTITY': $lc_text = TABLE_HEADING_QUANTITY; $lc_align = 'right'; break; case 'PRODUCT_LIST_WEIGHT': $lc_text = TABLE_HEADING_WEIGHT; $lc_align = 'right'; break; case 'PRODUCT_LIST_IMAGE': $lc_text = TABLE_HEADING_IMAGE; $lc_align = 'center'; break; case 'PRODUCT_LIST_BUY_NOW': $lc_text = TABLE_HEADING_BUY_NOW; $lc_align = 'center'; break; } if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) { $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text); } $list_box_contents[0][] = array('align' => $lc_align, 'params' => 'class="productListing-heading"', 'text' => ' ' . $lc_text . ' '); } if ($listing_split->number_of_rows > 0) { $rows = 0; $listing_query = tep_db_query($listing_split->sql_query); while ($listing = tep_db_fetch_array($listing_query)) { $rows++; if (($rows/2) == floor($rows/2)) { $list_box_contents[] = array('params' => 'class="productListing-even"'); } else { $list_box_contents[] = array('params' => 'class="productListing-odd"'); } $cur_row = sizeof($list_box_contents) - 1; for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { $lc_align = ''; switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_align = ''; $lc_text = ' ' . $listing['products_model'] . ' '; break; case 'PRODUCT_LIST_NAME': $lc_align = ''; if (isset($HTTP_GET_VARS['manufacturers_id'])) { //PRODUCT EXTRA FIELDS IN PRODUCT LISTING - BEGINING //$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . //$listing['products_name'] . '</a> '; // } // break; $extra_fields_text = ''; $extra_fields_query = tep_db_query(" SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef LEFT JOIN ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf ON ptf.products_extra_fields_id=pef.products_extra_fields_id WHERE ptf.products_id=". (int) $listing['products_id'] ." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."') ORDER BY products_extra_fields_order"); while ($extra_fields = tep_db_fetch_array($extra_fields_query)) { if (! $extra_fields['status']) continue; $extra_fields_text = $extra_fields_text. '<font color="#000000">'.$extra_fields['name'].': </font>' . '<font color="#006600">' .$extra_fields['value'].'<BR></font>'; } $lc_text = '<b><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $fldname . '</a></b> <br>' . $extra_fields_text . '<br>'; } break; // PRODUCT EXTRA FIELDS IN PRODUCT LISTING - END case 'PRODUCT_LIST_MANUFACTURER': $lc_align = ''; $lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a> '; break; case 'PRODUCT_LIST_PRICE': $lc_align = 'right'; if (tep_not_null($listing['specials_new_products_price'])) { $lc_text = ' <s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> '; } else { $lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' '; } break; case 'PRODUCT_LIST_QUANTITY': $lc_align = 'right'; $lc_text = ' ' . $listing['products_quantity'] . ' '; break; case 'PRODUCT_LIST_WEIGHT': $lc_align = 'right'; $lc_text = ' ' . $listing['products_weight'] . ' '; break; case 'PRODUCT_LIST_IMAGE': $lc_align = 'center'; 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']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; } else { $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> '; } break; case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> '; break; } $list_box_contents[$cur_row][] = array('align' => $lc_align, 'params' => 'class="productListing-data"', 'text' => $lc_text); } } new productListingBox($list_box_contents); } else { $list_box_contents = array(); $list_box_contents[0] = array('params' => 'class="productListing-odd"'); $list_box_contents[0][] = array('params' => 'class="productListing-data"', 'text' => TEXT_NO_PRODUCTS); new productListingBox($list_box_contents); } if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td> </tr> </table> <?php } ?> Quote Link to comment Share on other sites More sharing options...
captainbohica Posted August 31, 2008 Share Posted August 31, 2008 update - i reverted back to the default product_listing.php file, because when i installed AZRESTA's contribution, my extra fields appeared INSIDE the product name column...... anyone have that problem? how did you fix it? Quote Link to comment Share on other sites More sharing options...
captainbohica Posted September 1, 2008 Share Posted September 1, 2008 bump. anyone? Quote Link to comment Share on other sites More sharing options...
northshore Posted September 29, 2010 Share Posted September 29, 2010 (edited) Hi, Can someone help me with this contribution? I am trying to get the Product extra fields to show-up in the product listing. But i'm using the product_listing_tpl.php file instead of the product_listing.php file and this mod doesn't work. I don't have a code line matching what is suggested in the instructions to replace?? If anyone knows what line I should replace with the provided code I would apprec. it. working on this for hours: 13. Extra Fields in product listing (optional) In catalog/includes/modules/product_listings.php FIND $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> '; } break; REPLACE WITH //PRODUCT EXTRA FIELDS IN PRODUCT LISTING - BEGINING //PRODUCT EXTRA FIELDS IN PRODUCT LISTING - BEGINING //$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . //$listing['products_name'] . '</a> '; // } // break; $extra_fields_text = ''; $extra_fields_query = tep_db_query(" SELECT pef.languages_id, pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef LEFT JOIN ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf ON ptf.products_extra_fields_id=pef.products_extra_fields_id WHERE ptf.products_id=". (int) $listing[$x]['products_id'] ." and pef.languages_id=" . (int)$languages_id . " and ptf.products_extra_fields_value<>'' ORDER BY products_extra_fields_order"); while ($extra_fields = tep_db_fetch_array($extra_fields_query)) { if (! $extra_fields['status']) continue; $extra_fields_text = $extra_fields_text. '<font color="#000000">'.$extra_fields['name'].': </font>' . '<font color="#006600">' .$extra_fields['value'].'<BR></font>'; } $lc_text = ' <b><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a></b><br> ' . $extra_fields_text . '<br>'; } break; // PRODUCT EXTRA FIELDS IN PRODUCT LISTING - END Edited September 29, 2010 by northshore Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.