dremhmrk2 Posted October 19, 2009 Share Posted October 19, 2009 Spooks, You're a genius, thank you for your contribution! I had been struggling with setting up a grid layout for my products and your contrib solved my headaches on that front. Now, I have just one question. I have Product Extra Fields contrib installed and fully populated with data. My extra fields are appearing in the specific product info pages and the extra fields are appearing no problem in my new products list. However, I can't seem to get the Product Extra Fields to show up in my general product lists. I'm not certain what to do with my product_listing.php to get these extra fields to show. Any advice? Quote Link to comment Share on other sites More sharing options...
spooks Posted October 19, 2009 Author Share Posted October 19, 2009 Product Extra Fields contrib I don't know that one, can u give details, & what u are adding to the new page. Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al. Link to comment Share on other sites More sharing options...
dremhmrk2 Posted October 19, 2009 Share Posted October 19, 2009 (edited) Product Extra Fields contrib I don't know that one, can u give details, & what u are adding to the new page. Sure. http://www.topperliquidators.com is the site. You can see on the homepage, displayed via the New Products module. The "unit prices" are supplied by the "Product Extra Fields" contrib. here's the new_products.php code: <style> a { border: none; border-top-style: none; color:#000000; } </style> <?php $info_box_contents = array(); $i = 0; $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B'))); //new contentBoxHeading($info_box_contents); /*if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); } else { */ $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by rand() limit " . MAX_DISPLAY_NEW_PRODUCTS); // } $row = 0; $col = 0; $info_box_contents = array(); while ($new_products = tep_db_fetch_array($new_products_query)) { $new_products['products_name'] = tep_get_products_name($new_products['products_id']); $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="" width="" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a>', 'text1' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>', 'text2' => $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])), 'text3' => $new_products['products_id']); $col ++; if ($col > 2) { $col = 0; $row ++; } } ?> <tr> <td width="100%"> <p> </p> <p align="center"><strong>Welcome to Topper Liquidators!</strong></p> <p> </p> </td> </tr> <table class="" border="0" cellspacing="0" cellpadding="0"> <tr> <?php foreach($info_box_contents as $contents) { //print_r($contents); foreach($contents as $newCont) : /*print_r($contents[0]['text']); print_r($contents[1]['text']); print_r($contents[2]['text']); print_r($contents[3]['text']); die;*/ ?> <?php // START: Extra Fields Contribution v2.0b - mintpeel display fix $extra_field_value = ""; $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)$newCont['text3']." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".(int)$languages_id."') ORDER BY products_extra_fields_order"); $extra_fields = tep_db_fetch_array($extra_fields_query); $extra_field_name = $extra_fields['name']; if($extra_fields['value'] != "") $extra_field_value = stripslashes($extra_fields['value']); ?><td> <!-- products table starts here --><table class="list" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan='2' class="leftpad"><h2> <?php echo htmlspecialchars_decode(stripslashes($newCont['text'])); ?> </h2></td></tr> <tr> <td rowspan="2" valign="top" class="productimg"> <?php echo $newCont['text1']; ?> <?php echo '<br/><font size="2" color="#ff0000"><b>' . $extra_field_value .'</b></font>';?></td> <td align="left" class="rightpad"> </td> </tr> <tr> <td valign="bottom" align="right" class="rightpad"><br /> <br /> <span class="red"> </span></td> </tr> <tr> <td align="left" colspan='2' class="leftpad"><span class="btn_img"> </span><span style="padding:0 35px 0 45px"><span class="size22"> </span> <?php if(substr($newCont['text2'],0,1) != "$"){ ?> <span class="size12"><?php echo $newCont['text2']; ?></span> <?php } else{ ?> <span class="size35"><font size="2">Price: </font><?php echo $newCont['text2']; ?></span><?php } ?><span class="size22"></span></span></td> </tr> </table><!-- products table ends here --></td> <?php $i++; if($i % 4 == 0) echo "</tr><tr>"; endforeach; } ?> </table> <?php //new contentBox($info_box_contents); ?> The pertinent code starts at line 66. I also have them showing up correctly on the individual product info pages, like http://www.topperliquidators.com/gucci-1546s-0bnz-blue-dark-grey-gradient-sunglasses-liquidation-p-488.html The product_info.php code is: <?php /* $Id: product_info.php 1739 2007-12-20 00:52:16Z hpdl $ adapted for Separate Pricing Per Customer v4 2005/03/06 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); // BOF Separate Price per Customer if(!tep_session_is_registered('sppc_customer_group_id')) { $customer_group_id = '0'; } else { $customer_group_id = $sppc_customer_group_id; } // EOF Separate Price per Customer ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo $titletag; ?></title> <?php $keywordtag = str_replace("\"","'",$keywordtag); ?> <meta NAME="Keywords" content="<?php echo $keywordtag; ?>"> <meta NAME="Description" content="<?php echo $description; ?>"> <meta content="yes" name="allow-search"> <meta name="robots" CONTENT="index, follow"> <meta name="googlebot" content="index, follow"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta NAME="copyright" CONTENT="Copyright � 2009 by Topper International 1998-2006"> <meta name="msvalidate.01" content="61ABA6602A0545C091B4F42A1068299B" /> <link rel="canonical" href="<?php CanonicalUrl(); ?>" /> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <!--[if IE 7 ]> <link rel="stylesheet" type="text/css" href="stylesheetIE7.css"> <![endif]--> <!--[if IE 6 ]> <link rel="stylesheet" type="text/css" href="stylesheetIE6.css"> <![endif]--> <!--script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.lightbox-0.5.js"></script> <link rel="stylesheet" type="text/css" href="jquery.lightbox-0.5.css" media="screen" /--> <!--script type="text/javascript"> $(function() { $('#gallery a').lightBox(); }); </script--> <script language="javascript"><!-- function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150') } //--></script> <link rel="stylesheet" href="lightbox.css" type="text/css" media="screen" /> <script type="text/javascript" src="js/prototype.js"></script> <script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script> <script type="text/javascript" src="js/lightbox.js"></script> <?php if (!isset($lng) || (isset($lng) && !is_object($lng))) { include_once(DIR_WS_CLASSES . 'language.php'); $lng = new language; } reset($lng->catalog_languages); while (list($key, $value) = each($lng->catalog_languages)) { ?> <link rel="alternate" type="application/rss+xml" title="<?php echo STORE_NAME . ' - ' . BOX_INFORMATION_RSS; ?>" href="<?php echo FILENAME_RSS, '?language=' . $key.((isset($_GET['cPath']))?'&cPath='.$_GET['cPath']:'').((isset($_GET['manufacturers_id']))?'&manufacturers_id='.$_GET['manufacturers_id']:''); ?>"> <?php } ?> <script language="javascript"> function selectEventTop(evt) { //alert(document.getElementById("quantityTop").selectedIndex); document.getElementById("quantity").selectedIndex=document.getElementById("quantityTop").selectedIndex; } function selectEventButtom(evt) { //alert(document.getElementById("quantityTop").selectedIndex); document.getElementById("quantityTop").selectedIndex=document.getElementById("quantity").selectedIndex; } </script> </head> <!--body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"--> <body> <!--div id="wrapper"--> <!--main wrapper starts here--><table width="100%" border="0" cellspacing="0" cellpadding="0" id="wrapper"> <tr> <td> <!--main table starts here--><table id="maintable" border="0" cellspacing="0" cellpadding="0"> <!--tr--> <!--header starts here--><!--td valign="middle" align="left" id="header"--> <!--div id="header"--> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <tr> <td> <!--Contents starts here--><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <!--left panel starts here--><td valign="top" align="left" width="147px"> <ul class="categories"> <!--td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"--> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> <!--/table></td--> </ul> <?php require(DIR_WS_INCLUDES . 'column_left_links_SSL.php'); ?> </td><!--left panel ends here--> <td valign="top" align="left" class="listings" > <!-- products table starts here --> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <!--table border="0" width="100%" cellspacing="3" cellpadding="3"--> <tr> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php if ($product_check['total'] < 1) { ?> <tr> <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } else { //$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); // BOF MaxiDVD: Modified For Ultimate Images Pack! $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_free_shipping, p.products_date_added, p.products_date_available, p.manufacturers_id, p.enable_credit_card from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); // EOF MaxiDVD: Modified For Ultimate Images Pack! // BOF - astro - Multiple Images //$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.product_image_2, p.product_image_3, p.product_image_4, p.product_image_5, p.product_image_6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.enable_credit_card from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); // EOF - astro - Multiple Images $product_info = tep_db_fetch_array($product_info_query); // RSS feed code added by SDEI to display particular product's info on RSS page $rss_subtitle= $product_info['products_name']; $rss_title = BOX_INFORMATION_RSS_CATEGORY; $image = $product_info['products_image']; $rss_params = '&products_id='.$product_info['products_id']; $rss_feed_link = ''; if ($rss_subtitle != '') { $rss_feed_link = '<a href="'.FILENAME_RSS.'?language='. $lang_code.$rss_params.'" title="'.$rss_title.' - '.$rss_subtitle.'">'.tep_image(DIR_WS_IMAGES . 'icons/rss_icon.gif' , $rss_title.' - '.$rss_subtitle).'</a>'; } // --- RSS code end here--- tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); /* if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); }*/ if ($new_price = tep_get_products_special_price($product_info['products_id'])) { // BOF Separate Price per Customer $scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id = '" . $customer_group_id . "'"); if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) { $product_info['products_price']= $scustomer_group_price['customers_group_price']; } // EOF Separate Price per Customer $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { // BOF Separate Price per Customer $scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id = '" . $customer_group_id . "'"); if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) { //$product_info['products_price']= $scustomer_group_price['customers_group_price']; } // EOF Separate Price per Customer $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = html_entity_decode($product_info['products_name'], ENT_QUOTES); } ?> <?php // START: Extra Fields Contribution v2.0b - mintpeel display fix $extra_fields_query = tep_db_query(" SELECT pef.products_extra_fields_order, 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)$HTTP_GET_VARS['products_id'] ." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".(int)$languages_id."') ORDER BY pef.products_extra_fields_order"); echo '<tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="2px">'; while ($extra_fields = tep_db_fetch_array($extra_fields_query)) { if (! $extra_fields['status']) // show only enabled extra field continue; echo'<tr><td class="main" align="left" valign="middle"><font size="4" color="#ff0000"><b>'.$extra_fields['name'].': ' . stripslashes($extra_fields['value']).'</b></font></td></tr>'; } echo' </table> </td> </tr>'; // END: Extra Fields Contribution - mintpeel display fix ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0" class=""> <tr> <td class="" valign="top">Products Name:</td><td> </td> <td class="pageHeading" align="left" valign="top"><?php echo $products_name; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="" valign="top">Liquidation Price:</td><td> </td> <td class="pageHeading" align="left" valign="top"><?php echo $products_price; ?></td> </tr> <?php if ($product_info['products_free_shipping'] && FREE_SHIPPING_TO_ALL_COUNTRIES == "true") { echo ('<tr><td colspan="" align="" class=""><b>'.FREE_SHIPPING_FOR_THIS_PRODUCT.'</b></td></tr>'); } if ($product_info['products_free_shipping'] && FREE_SHIPPING_TO_ALL_COUNTRIES == "false") { echo ('<tr><td colspan="" align="" class=""><b>'.FREE_SHIPPING_FOR_THIS_PRODUCT_FOR_SHOP_COUNTRY.'</b></td></tr>'); } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <!--tr> <td class="" valign="top">Quantity Available:</td><td> </td> <td class="pageHeading" align="left" valign="top"><?php //echo $product_info['products_quantity']; ?></td> </tr--> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php while ($extra_fields = tep_db_fetch_array($extra_fields_query)) { if (! $extra_fields['status']) // show only enabled extra field continue; echo'<tr><td class="" valign="top">'.$extra_fields['name'].': </td><td> </td><td class="pageHeading" align="left" valign="top">' . htmlspecialchars_decode(stripslashes($extra_fields['value'])).'</td></tr>'; ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if($product_info['products_description'] != ""){ ?> <tr> <td class="" valign="top">Details:</td><td> </td> <td class="pageHeading" align="left" valign="top"><?php echo html_entity_decode($product_info['products_description'], ENT_QUOTES); ?> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } ?> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"> <?php if (tep_not_null($product_info['products_image'])) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2" align="left"> <tr> <?php // START: Extra Fields Contribution v2.0b - mintpeel display fix $extra_fields_query = tep_db_query(" SELECT pef.products_extra_fields_order, 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)$HTTP_GET_VARS['products_id'] ." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".(int)$languages_id."') ORDER BY pef.products_extra_fields_order"); echo '<tr> <td width="100%"> <table border="0" align="center" width="100%" cellspacing="0" cellpadding="2px">'; while ($extra_fields = tep_db_fetch_array($extra_fields_query)) { if (! $extra_fields['status']) // show only enabled extra field continue; echo'<tr><td class="main" align="center" width="100%" valign="middle"><p align="center"><font size="4" color="#ff0000"><b>'.$extra_fields['name'].': ' . stripslashes($extra_fields['value']).'</b></font></p></td></tr>'; } echo' </table> </td> </tr>'; // END: Extra Fields Contribution - mintpeel display fix ?> <td align="left" class="smallText"> <table> <tr> <td valign="top"><?php echo tep_image(DIR_WS_IMAGES . 'person.jpg'); ?></td> <td class="smallText"><?php //echo '<a href="' . tep_href_link(FILENAME_ASK_QUESTION, 'products_id='.$product_info['products_id']) . '">' . TEXT_ASK_QUESTION . '</a>'; echo '<a href="'.$product_info['products_id'].'-ask.html">'. TEXT_ASK_QUESTION . '</a>';?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <!--td width="10" class="smallText">Quantity</td> <td width="10" class="smallText"><input type"text" id="txtQt" name="txtQt" style="width:30px" value="1"></td--> <?php if($product_info['enable_credit_card'] == 1){ ?> <?php // BOF: MOD - EASY CALL FOR PRICE v1.4 /* <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> */ if ($product_info['products_price'] == CALL_FOR_PRICE_VALUE){ ?> <td class="main" align="left" valign="middle" width="20%"> <a href="javascript:history.go(-1)"><?php echo tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE); ?></a></td> <?php } else { ?> <td class="main"> <?php if ($product_info['products_quantity'] - $product_info['products_ordered'] == 0) { echo TEXT_PRODUCT_STOCK; if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available']));} } else { echo "<select size=\"1\" name=\"quantityTop\" id=\"quantityTop\" onChange=\"selectEventTop(this)\">"; for ($i=1; $i <= $product_info['products_quantity'] - $product_info['products_ordered']; $i++) { if($i > 20)break; echo "<option>".$i."</option>"; } echo "</select>"; } ?> </td> <td class="main"><?php echo TEXT_PRODUCT_QUANTITY; ?></td> <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('addtocart_new.jpg', IMAGE_BUTTON_IN_CART); ?></td> <?php } // EOF: MOD - EASY CALL FOR PRICE v1.4 ?> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <?php } ?> </tr> </table> </td> </tr> <tr> <td align="left" class="smallText"> <!--div id="gallery"--> <!--script language="javascript"><!-- document.write('<?php //echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); //--><!--/script--> <!--noscript--> <?php //echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> <!--/noscript--> <?php //echo '<a href="\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\'">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> <?php //echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; //echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" rel="lightbox">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; //echo tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], '','', 'hspace="5" vspace="5"'); /*if($product_info['product_image_2'] != "") { echo '<br/>' .tep_image(DIR_WS_IMAGES . $product_info['product_image_2'], $product_info['products_name'], '', '', 'hspace="5" vspace="5"'); } if($product_info['product_image_3'] != "") { echo '<br/>' .tep_image(DIR_WS_IMAGES . $product_info['product_image_3'], $product_info['products_name'], '', '', 'hspace="5" vspace="5"'); } if($product_info['product_image_4'] != "") { echo '<br/>' .tep_image(DIR_WS_IMAGES . $product_info['product_image_4'], $product_info['products_name'], '', '', 'hspace="5" vspace="5"'); } if($product_info['product_image_5'] != "") { echo '<br/>' .tep_image(DIR_WS_IMAGES . $product_info['product_image_5'], $product_info['products_name'], '', '', 'hspace="5" vspace="5"'); } if($product_info['product_image_6'] != "") { echo '<br/>' .tep_image(DIR_WS_IMAGES . $product_info['product_image_6'], $product_info['products_name'], '', '', 'hspace="5" vspace="5"') ; }*/ ?> <!-- // BOF MaxiDVD: Modified For Ultimate Images Pack! //--> <?php $small_image = $product_info['products_image']; $popup_image = $product_info['products_image_med']; if ($popup_image == '') $popup_image = $small_image; echo tep_image(DIR_WS_IMAGES . $small_image, $product_info['products_name'], '', '', 'hspace="1" vspace="1"'); //echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $popup_image) . '" target="_blank" rel="lightbox" title="' . $product_info['products_name'] . '">' . tep_image(DIR_WS_IMAGES . $small_image, $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br/>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?> <!-- // EOF MaxiDVD: Modified For Ultimate Images Pack! //--> <!--/div--> </td> </tr> </table> <?php } ?> <?php $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { ?> <table border="5" cellspacing="0" cellpadding="2"> <tr> <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td> </tr> <?php $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td> </tr> <?php } ?> </table> <?php } ?> </td> </tr> <?php // BOF MaxiDVD: Modified For Ultimate Images Pack! if (ULTIMATE_ADDITIONAL_IMAGES == 'enable') { include(DIR_WS_MODULES . 'additional_images.php'); } // EOF MaxiDVD: Modified For Ultimate Images Pack! ; ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $reviews = tep_db_fetch_array($reviews_query); if ($reviews['count'] > 0) { ?> <tr> <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (tep_not_null($product_info['products_url'])) { ?> <tr> <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { ?> <!--tr> <td align="center" class="smallText"><?php //echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td> </tr--> <?php } else { ?> <!--tr> <td align="center" class="smallText"><?php //echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td> </tr--> <?php } ?> <!-- social bookmarks start //--> <?php include(DIR_WS_MODULES . 'social_bookmarks' . '.php'); ?> <!-- social bookmarks finish //--> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td> <table width="100%" cellspacing="0" cellpadding="0" class="infoBoxWhite" style="border:solid #000000 1px;"> <tr class="infoBoxContentsWhite"> <td align="right"> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td align="left"> <?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?> </td> <!--td class="main"><?php //echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td--> <!--td class="main" align="center"><?php //echo '<a href="' . tep_href_link(FILENAME_TELL_A_FRIEND, tep_get_all_get_params()) . '">' . tep_image_button('button_tell_a_friend_extra.gif', IMAGE_BUTTON_TELL_A_FRIEND) . '</a>'; ?></td--> <td class="smallText" align="left" width="40%"><?php echo getTaf('',addslashes($product_info['products_name'])); ?></td> <!--td class="smallText" align="right">Quantity </td> <td class="main1" align="right" width="30px"><input type"text" id="txtQt" name="txtQt" style="width:30px" value="1"></td--> <?php if($product_info['enable_credit_card'] == 1){ ?> <?php // BOF: MOD - EASY CALL FOR PRICE v1.4 /* <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> */ if ($product_info['products_price'] == CALL_FOR_PRICE_VALUE){ ?> <td class="main" align="left" valign="middle" width="20%"> <a href="javascript:history.go(-1)"><?php echo tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE); ?></a></td> <?php } else { ?> <td class="main"> <?php if ($product_info['products_quantity'] - $product_info['products_ordered'] == 0) { echo TEXT_PRODUCT_STOCK; if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available']));} } else { echo "<select size=\"1\" name=\"quantity\" id=\"quantity\" onChange=\"selectEventButtom(this)\">"; for ($i=1; $i <= $product_info['products_quantity'] - $product_info['products_ordered']; $i++) { if($i > 20)break; echo "<option>".$i."</option>"; } echo "</select>"; } ?> </td> <td class="main"><?php echo TEXT_PRODUCT_QUANTITY; ?></td> <td class="main" align="left" valign="middle" width="20%"> <?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> <?php } // EOF: MOD - EASY CALL FOR PRICE v1.4 ?> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <?php } ?> </tr> </table> </td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td> <?php if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); // echo "Bottom ".DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS; } } ?> </td> </tr> <tr><td align="center"><a href="javascript:void(0);" onClick="javascript:window.open('<?php echo FILENAME_RSS, '?language=' . $lang_code.$rss_params; ?>','','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=350');" title="<?php echo $rss_title.' - '.$rss_subtitle; ?>"><?php echo tep_image(DIR_WS_IMAGES . "icons/rss_icon.gif" , $rss_title . " - " . $rss_subtitle); ?></a><?php //echo $rss_feed_link; ?></td></tr> </table></form></td> <!-- body_text_eof //--> <!--td width="<?php //echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php //echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"--> <!-- right_navigation //--> <?php //require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> <!--/table></td--> </tr> </table> <!--/div--> <!-- body_eof //--> <!--/div--> <!-- footer //--> <!--div id="footer"--> </td> </tr> </table><!--Contents ends here--> </td> </tr> <tr> <td> </td> </tr> </table> <!--main table ends here--> </td> </tr> <tr> <td valign="top" align="center" id="footer"> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!--/div--> <!-- footer_eof //--> </td> </tr> </table> <!--main wrapper ends here--> </body> <!--/div--> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> I want the "xPCS @ $x Each" to show up in a grid layout for all categories. Edited October 19, 2009 by dremhmrk2 Quote Link to comment Share on other sites More sharing options...
spooks Posted October 19, 2009 Author Share Posted October 19, 2009 Can u give a link to the actual contrib (don't like the look of the code used, so need to see just what they're doing so can make better.) Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al. Link to comment Share on other sites More sharing options...
dremhmrk2 Posted October 20, 2009 Share Posted October 20, 2009 Can u give a link to the actual contrib (don't like the look of the code used, so need to see just what they're doing so can make better.) http://addons.oscommerce.com/info/2202 I know it's "mostly" set up correctly, at least as far as the admin side and the database sides go, I just need to add the specific field to your grid template. Thanks so much! Quote Link to comment Share on other sites More sharing options...
Goerg Posted October 20, 2009 Share Posted October 20, 2009 Hi Sam (and anyone who can help me) I have an oscommerce with Separate Price per customer 4.2 installed and working. I'm trying to add this contribution and I´m having problems specially with product_listing.php. If I add the Separate Price code (I tried in line 86 of the Product Listing version), I have errors. This is the code I guess is what must be added (but maybe not the only one) ************************************************************************************* // BOF Separate Pricing per Customer $no_of_listings = tep_db_num_rows($listing_query); // global variable (session) $sppc_customer_group_id -> local variable customer_group_id if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') { $customer_group_id = $_SESSION['sppc_customer_group_id']; } else { $customer_group_id = '0'; } while ($_listing = tep_db_fetch_array($listing_query)) { $listing[] = $_listing; $list_of_prdct_ids[] = $_listing['products_id']; } // next part is a debug feature, when uncommented it will print the info that this module receives /* echo '<pre>'; print_r($listing); echo '</pre>'; */ // get all product prices for products with the particular customer_group_id // however not necessary for customer_group_id = 0 if ($customer_group_id != '0') { $pg_query = tep_db_query("select pg.products_id, customers_group_price as price from " . TABLE_PRODUCTS_GROUPS . " pg where products_id in (" . implode(',', $list_of_prdct_ids) . ") and pg.customers_group_id = '" . $customer_group_id . "'"); while ($pg_array = tep_db_fetch_array($pg_query)) { $new_prices[] = array ('products_id' => $pg_array['products_id'], 'products_price' => $pg_array['price'], 'specials_new_products_price' => '', 'final_price' => $pg_array['price']); } for ($x = 0; $x < $no_of_listings; $x++) { // replace products prices with those from customers_group table if(!empty($new_prices)) { for ($i = 0; $i < count($new_prices); $i++) { if( $listing[$x]['products_id'] == $new_prices[$i]['products_id'] ) { $listing[$x]['products_price'] = $new_prices[$i]['products_price']; $listing[$x]['final_price'] = $new_prices[$i]['final_price']; } } } // end if(!empty($new_prices) $listing[$x]['specials_new_products_price'] = ''; // makes sure that a retail specials price doesn't carry over to another customer group $listing[$x]['final_price'] = $listing[$x]['products_price']; // final price should not be the retail special price } // end for ($x = 0; $x < $no_of_listings; $x++) } // end if ($customer_group_id != '0') // an extra query is needed for all the specials $specials_query = tep_db_query("select products_id, specials_new_products_price from " . TABLE_SPECIALS . " where products_id in (" . implode(',', $list_of_prdct_ids) . ") and status = '1' and customers_group_id = '" . $customer_group_id . "'"); while ($specials_array = tep_db_fetch_array($specials_query)) { $new_s_prices[] = array ('products_id' => $specials_array['products_id'], 'products_price' => '', 'specials_new_products_price' => $specials_array['specials_new_products_price'] , 'final_price' => $specials_array['specials_new_products_price']); } // add the correct specials_new_products_price and replace final_price for ($x = 0; $x < $no_of_listings; $x++) { if(!empty($new_s_prices)) { for ($i = 0; $i < count($new_s_prices); $i++) { if( $listing[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) { $listing[$x]['specials_new_products_price'] = $new_s_prices[$i]['specials_new_products_price']; $listing[$x]['final_price'] = $new_s_prices[$i]['final_price']; } } } // end if(!empty($new_s_prices) } // end for ($x = 0; $x < $no_of_listings; $x++) **************************************************************** Anyone can help me? Thanks! Jorge Quote Link to comment Share on other sites More sharing options...
spooks Posted October 20, 2009 Author Share Posted October 20, 2009 Separate Price per customer I`m surprised that contrib is modifying the listing, if all u need is to get a customer specific price, since the sql is created in index.php, so it would make sense to modify it there (index.php) to get correct price, then pass a valid sql to product listing. I suggest u raise the point in the support forum for Separate Price per customer & ask if that can be done. Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al. Link to comment Share on other sites More sharing options...
dremhmrk2 Posted October 20, 2009 Share Posted October 20, 2009 Spooks, Regarding my product extra fields, how would YOU add ANY field to a page? I know the fields exist, and I know what they are called... how would I add them into the thumbnail grid layout? Quote Link to comment Share on other sites More sharing options...
dremhmrk2 Posted October 21, 2009 Share Posted October 21, 2009 Spooks, I'm really in a jam with this... Your grid view is so beautiful, I want to use it but my boss is demanding the extra fields, I'm getting heat from him pretty hard haha. Quote Link to comment Share on other sites More sharing options...
spooks Posted October 21, 2009 Author Share Posted October 21, 2009 Spooks, I'm really in a jam with this... Your grid view is so beautiful, I want to use it but my boss is demanding the extra fields, I'm getting heat from him pretty hard haha. Sorry, u need to wait till I've time , tell him he must never be demanding when requesting free support. Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al. Link to comment Share on other sites More sharing options...
dremhmrk2 Posted October 21, 2009 Share Posted October 21, 2009 Sorry, u need to wait till I've time , tell him he must never be demanding when requesting free support. He just came and asked what was taking so long, I told him that I was in contact with the original software engineer who worked on our product display plugin. He was shocked that I had reached "the creator" and wanted to know how much it was costing the company to be communicating with you :D I told him it costs nothing but takes time. Thank you sir Quote Link to comment Share on other sites More sharing options...
sclif Posted October 21, 2009 Share Posted October 21, 2009 Can i add to this Add-On the ability to disable the display of products in the list if their quantity in stock = 0? If yes, how? Thanks. Quote Link to comment Share on other sites More sharing options...
vinally Posted October 22, 2009 Share Posted October 22, 2009 Does it work with Additional Images for STS content pages - Version 1 ( latest version )? Or i need to handcode product listing using compare utility? Quote Link to comment Share on other sites More sharing options...
spooks Posted October 22, 2009 Author Share Posted October 22, 2009 Does it work with Additional Images for STS content pages - Version 1 ( latest version )? Or i need to handcode product listing using compare utility? I know others have used this with STS, I`ve never heard of any issues. The included product_listing.php file is a complete re-write, a file compare with the old would be pointless. Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al. Link to comment Share on other sites More sharing options...
multimixer Posted October 22, 2009 Share Posted October 22, 2009 Does it work with Additional Images for STS content pages - Version 1 ( latest version )? Or i need to handcode product listing using compare utility? I answered already to you that yes, look here Quote My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
spooks Posted October 22, 2009 Author Share Posted October 22, 2009 disable the display of products if stock = 0?[quote name='sclif' date='21 October 2009 - 04:35 PM' timestamp='1256139328' post='1450068'] Please, don`t shout!! Yes, its already built in, just change product status to 'sold out', there is a mod somewhere (don`t remember where) that will automaticallty set a product status to 'sold out' when stock reaches 0 Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al. Link to comment Share on other sites More sharing options...
spooks Posted October 22, 2009 Author Share Posted October 22, 2009 (edited) Product extra fields addition. Spooks, I'm really in a jam with this... Your grid view is so beautiful, I want to use it but my boss is demanding the extra fields, I'm getting heat from him pretty hard haha. Sorry for the delay, the code the contrib instructs you to add would not work, even on a default install, as they seem to be trying to use code pasted from categories.php!! They are also using LEFT JOIN a lot, when, as far as I can see there is no need (I don't have this added anywhere so can't be certain of the data structure) you should never use joins if you can avoid it, it adds extra load to the server. They are also selecting data from the dbase, then exluding it with php, not good!! This snippit addresses those, but I can't test, so let me know how you get on. I've added the xtra fields after the name field, i assumed u would want it there. product_listing.php line 373 case 'PRODUCT_LIST_NAME': $display .= '<table summary="" width="100%" ><tr><td class="thumbcontent" height="'.PRODUCT_NAME_VSPACE.'" >'.$name.'</td></tr></table>'; break; replace with: case 'PRODUCT_LIST_NAME': $extra_fields_text = ''; $extra_fields_query = tep_db_query(" SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef, ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf WHERE ptf.products_extra_fields_id=pef.products_extra_fields_id and ptf.products_id=". (int) $products['products_id'] ." and pef.languages_id=" . (int)$languages_id . " and ptf.products_extra_fields_value<>'' and pef.products_extra_fields_status <> 0 ORDER BY products_extra_fields_order"); while ($extra_fields = tep_db_fetch_array($extra_fields_query)) { $extra_fields_text .= '<tr><td class="smallText"><span class="xtra-field-name">' . $extra_fields['name'] . ': </span><span class="xtra-field-value">' . $extra_fields['value'] . '</span></td></tr>'; } $display .= '<table summary="" width="100%" ><tr><td class="thumbcontent" height="'.PRODUCT_NAME_VSPACE.'" >'.$name.'</td></tr>' . $extra_fields_text . '</table>'; break; You will need to add a couple of entries to your css, adjust these as u want. .xtra-field-name{ color: #000; } .xtra-field-value{ color: #006600; } Edited October 22, 2009 by spooks Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al. Link to comment Share on other sites More sharing options...
vinally Posted October 22, 2009 Share Posted October 22, 2009 I know others have used this with STS, I`ve never heard of any issues. The included product_listing.php file is a complete re-write, a file compare with the old would be pointless. Hi spooks, I noticed that AI modules (latest version) did touch product_listing.php file. Can i go ahead replace it with included product_listing.php, though it say that it will work with AI module (below v1.6? if remember correctly) and i am also not sure whether it will work with this contribution v2 (latest version). Can you advise? thanks again. Quote Link to comment Share on other sites More sharing options...
spooks Posted October 22, 2009 Author Share Posted October 22, 2009 Hi spooks, I noticed that AI modules (latest version) did touch product_listing.php file. Can i go ahead replace it with included product_listing.php, though it say that it will work with AI module (below v1.6? if remember correctly) and i am also not sure whether it will work with this contribution v2 (latest version). Can you advise? thanks again. In the docs is says: supports Additional Images (http://addons.oscommerce.com/info/1032) So why are u asking the question? Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al. Link to comment Share on other sites More sharing options...
vinally Posted October 22, 2009 Share Posted October 22, 2009 In the docs is says: supports Additional Images (http://addons.oscommerce.com/info/1032) So why are u asking the question? okie... let me try tonight and pray that it work. I like the grid display so much. anyway i will post here if i see any problem. Quote Link to comment Share on other sites More sharing options...
dremhmrk2 Posted October 22, 2009 Share Posted October 22, 2009 Product extra fields addition. Sorry for the delay, the code the contrib instructs you to add would not work, even on a default install, as they seem to be trying to use code pasted from categories.php!! They are also using LEFT JOIN a lot, when, as far as I can see there is no need (I don't have this added anywhere so can't be certain of the data structure) you should never use joins if you can avoid it, it adds extra load to the server. They are also selecting data from the dbase, then exluding it with php, not good!! This snippit addresses those, but I can't test, so let me know how you get on. I've added the xtra fields after the name field, i assumed u would want it there. product_listing.php line 373 case 'PRODUCT_LIST_NAME': $display .= '<table summary="" width="100%" ><tr><td class="thumbcontent" height="'.PRODUCT_NAME_VSPACE.'" >'.$name.'</td></tr></table>'; break; replace with: case 'PRODUCT_LIST_NAME': $extra_fields_text = ''; $extra_fields_query = tep_db_query(" SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef, ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf WHERE ptf.products_extra_fields_id=pef.products_extra_fields_id and ptf.products_id=". (int) $products['products_id'] ." and pef.languages_id=" . (int)$languages_id . " and ptf.products_extra_fields_value<>'' and pef.products_extra_fields_status <> 0 ORDER BY products_extra_fields_order"); while ($extra_fields = tep_db_fetch_array($extra_fields_query)) { $extra_fields_text .= '<tr><td class="smallText"><span class="xtra-field-name">' . $extra_fields['name'] . ': </span><span class="xtra-field-value">' . $extra_fields['value'] . '</span></td></tr>'; } $display .= '<table summary="" width="100%" ><tr><td class="thumbcontent" height="'.PRODUCT_NAME_VSPACE.'" >'.$name.'</td></tr>' . $extra_fields_text . '</table>'; break; You will need to add a couple of entries to your css, adjust these as u want. .xtra-field-name{ color: #000; } .xtra-field-value{ color: #006600; } Spooks, Thank you so much for replying. I have made your suggested changes by adding the small bit of CSS to the stylesheet and I have replaced the mentioned line with your modified code. It produces absolutely no results. No extra fields AND no errors. I cannot find anything additional in the source code. Just to make sure I was even editing the correct file, I changed $name to $xname to make sure it broke the site (which it did.) So I know I'm in the right file (product_listing.php.) Here is the current code: <?php /* $Id: product_listing.php, v 2.0 2009/10/17 22:49:59 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ $graphic_bord = 'no'; // set to 'yes' if you have older 'graphic borders' and not 'easy graphic borders'. $cat_path = false; // set to true to include category paths in urls $no_drop = false; // set to true to remove resuls/page & sort order drop downs if (tep_not_null($HTTP_GET_VARS['sort'])) $_GET['sort'] = $HTTP_GET_VARS['sort']; $max_results = (tep_not_null($_GET['max']) ? $_GET['max'] : MAX_DISPLAY_SEARCH_RESULTS); if (PRODUCTS_PER_ROW == 'PRODUCTS_PER_ROW' || PRODUCTS_PER_ROW == 0 || LISTING_SWITCH == 'LISTING_SWITCH') { $to = 'Setup Error!\nPlease ensure you have run the\nProduct Listing Setup File.' ; print "<script>alert('$to');</script>"; } // sort order array if ($_GET['sort'] == '0d') $sort_array[] = array('id' => 0 . 'd', 'text' => DATE_ORDER); for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { switch ($column_list[$i]) { case 'PRODUCT_LIST_MODEL': $sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_MODEL . APHA_ORDER); break; case 'PRODUCT_LIST_NAME': $sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_PRODUCTS . APHA_ORDER); break; case 'PRODUCT_LIST_MANUFACTURER': $sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_MANUFACTURER . APHA_ORDER); break; case 'PRODUCT_LIST_QUANTITY': $sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_QUANTITY . NUM_ORDER); break; case 'PRODUCT_LIST_WEIGHT': $sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_WEIGHT . NUM_ORDER); break; case 'PRODUCT_LIST_PRICE': $sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_PRICE . NUM_ORDER); break; } } for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { switch ($column_list[$i]) { case 'PRODUCT_LIST_MODEL': $sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_MODEL . REVERSE_ALPHA_ORDER); break; case 'PRODUCT_LIST_NAME': $sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_PRODUCTS . REVERSE_ALPHA_ORDER); break; case 'PRODUCT_LIST_MANUFACTURER': $sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_MANUFACTURER . REVERSE_ALPHA_ORDER); break; case 'PRODUCT_LIST_QUANTITY': $sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_QUANTITY . REVERSE_NUM_ORDER); break; case 'PRODUCT_LIST_WEIGHT': $sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_WEIGHT . REVERSE_NUM_ORDER); break; case 'PRODUCT_LIST_PRICE': $sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_PRICE . REVERSE_NUM_ORDER); break; } } // Max Results Array for ($i=1, $n=10; $i<$n; $i++) { $max_display[] = array('id' => MAX_DISPLAY_SEARCH_RESULTS * $i, 'text' => MAX_DISPLAY_SEARCH_RESULTS * $i); } $max_display[] = array('id' => 1000000, 'text' => 'Show All'); // store GET vars $get_vars = ''; reset($_GET); while (list($key, $value) = each($_GET)) { if ( ($key != 'sort') && ($key != 'max') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) { $get_vars .= tep_draw_hidden_field($key, $value); } } $top_nav = ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3')); $base_nav = ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')); $listing_split = new splitPageResults($listing_sql, $max_results, 'p.products_id'); $page_nav = '<table border="0" width="100%" cellspacing="0" cellpadding="2"><tr><td class="smallText">' . $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS) . '</td><td class="smallText" align="right">' . TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))) . '</td></tr></table>'; $drop = $no_drop ? '' : '<table border="0" width="100%" cellspacing="0" cellpadding="2"><tr><td class="smallText">Results/Page: '. tep_draw_form('maxdisplay', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get') . $get_vars . (isset($_GET['sort']) ? tep_draw_hidden_field('sort', $_GET['sort']) : '') . tep_draw_pull_down_menu('max', $max_display, $_GET['max'], 'onChange="this.form.submit();"') . tep_hide_session_id().'</form></td><td class="smallText" align="right">Sort Order: ' . tep_draw_form('sorting', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get') . $get_vars . (isset($_GET['max']) ? tep_draw_hidden_field('max', $_GET['max']) : '') . tep_draw_pull_down_menu('sort', $sort_array, $_GET['sort'], 'onChange="this.form.submit();"') . tep_hide_session_id().'</form></td></tr></table>'; if ( ($listing_split->number_of_rows > (int)$max_results) && $top_nav ) echo $page_nav; if ($top_nav && ($listing_split->number_of_rows > 0)) echo $drop; function tep_get_category_name($category_id, $language_id) { $category_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'"); $category = tep_db_fetch_array($category_query); return $category['categories_name']; } function tep_get_manufacturer_name($manufacturer_id) { $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$manufacturer_id . "'"); $manufacturer = tep_db_fetch_array($manufacturers_query); return $manufacturer['manufacturers_name']; } function list_box_head($column_list) { 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 = 'center'; break; case 'PRODUCT_LIST_NAME': $lc_text = TABLE_HEADING_PRODUCTS; $lc_align = ''; break; case 'PRODUCT_LIST_MANUFACTURER': $lc_text = TABLE_HEADING_MANUFACTURER; $lc_align = 'center'; 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 = (PRODUCT_LIST_OPTIONS == 'true' ? 'Product Options</td><td align="center" class="productListing-heading">' : '') . (strstr(LISTING_BUTTON, 'buy now')? TABLE_HEADING_BUY_NOW : TABLE_HEADING_DETAIL); $lc_align = 'center'; break; } if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) { $lc_text = tep_create_sort_heading($_GET['sort'], $col+1, $lc_text); } $list_box_contents[] = array('align' => $lc_align,'params' => 'class="productListing-heading"','text' => ' ' . $lc_text . ' '); } return ($list_box_contents); } // function list_head end function list_box_data($listing, $column_list) { global $PHP_SELF, $cPath, $cat_path; $currencies = new currencies(); $man_id = (tep_not_null($_GET['manufacturers_id']) ? $_GET['manufacturers_id'] : ''); $link = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id'] . ($man_id ? '&manufacturers_id='.$man_id : ($cPath && $cat_path ? '&cPath=' . $cPath : '')) ) . '"' . ($man_id || ($cat_path && $cat_path) ? ' rel="nofollow"' : '') . '>'; $buypic = (LISTING_BUTTON == 'buy now' ? 'button_in_cart.gif' : 'button_buy_now.gif'); $quantity_box = (PRODUCT_LIST_QUANTITY_BOX == 'true' ? 'Quantity: ' . tep_draw_input_field('cart_quantity','1','maxlength="5" size="5"') : ''); $form = tep_draw_form('cart_quantity', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action','products_id')) . 'action=add_product')); $buytable = '<table class="buytable" border="0" width="100%" cellspacing="0" cellpadding="2"><tr><td valign="bottom" class="productListing-data">'; $buytableend = '</td></tr></table></form>'; $button = (LISTING_BUTTON == 'buy now & details' ? tep_draw_hidden_field('products_id', $listing['products_id']) . tep_image_submit($buypic, IMAGE_BUTTON_BUY_NOW, 'class="thm_buy_now"') . ' <span class="buy_now">|</span> ' . $link . tep_image_button('button_details_small.gif', IMAGE_BUTTON_DETAILS, 'class="thm_buy_now"') . '</a>' : (strstr(LISTING_BUTTON, 'buy now') ? tep_draw_hidden_field('products_id', $listing['products_id']) . tep_image_submit($buypic, IMAGE_BUTTON_BUY_NOW) . '' : $link . tep_image_button('button_details.gif', IMAGE_BUTTON_DETAILS) . '</a>' )) ; if ($listing['products_price'] == 0) { $button = (strstr(LISTING_BUTTON, 'details') ? '<span class="buy_now"> </span>'. $link . tep_image_button('button_details_small.gif', IMAGE_BUTTON_DETAILS) . '</a> ' : ''); $quantity_box = '';} if (isset($listing['products_quantity']) && !$listing['products_quantity']) { $button = '<span class="buy_now"> </span>'. $link . tep_image_button('button_details_small.gif', IMAGE_BUTTON_DETAILS) . '</a> '; $quantity_box = '';} if (!strstr(PRODUCT_THUMBNAIL_VIEW, 'block')) { $list_box_temp = array('params' => 'class="list-block"'); for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { $lc_align = ''; $params = 'class="productListing-data" '; switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_align = 'center'; $lc_text = ' ' . $listing['products_model'] . ' '; break; case 'PRODUCT_LIST_NAME': $lc_align = ''; $lc_text = $link.'<b>' . $listing['products_name'] . '</b></a>' . ($listing['short_desc'] && (PRODUCT_SHORT_DESC == 'true') ? '<br /><span class="short">' . $listing['short_desc'] . '</span>' : ''); break; case 'PRODUCT_LIST_MANUFACTURER': $lc_align = 'center'; $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'; $lc_text = '<span class="productListing-list-price">'; $price = (function_exists(display_short_price)) ? $currencies->display_short_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) : $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])); 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 .= ($listing['products_price'] > 0 ? '' . $price . ' ' : ' ' . TEXT_POA); if (function_exists(tep_get_att_price)) $lc_text .= (tep_get_att_price($listing['products_id']) > 0 ? '+' : ' ') ; } $lc_text .= '</span>'; 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'; $lc_text = $link . tep_image(DIR_WS_IMAGES . (file_exists(DIR_WS_IMAGES . $listing['products_image']) ? $listing['products_image'] : 'no-image.jpg'), $listing['products_name'], PRODUCT_IMAGE_WIDTH, PRODUCT_IMAGE_HEIGHT) . '</a>'; break; case 'PRODUCT_LIST_BUY_NOW': if (PRODUCT_LIST_OPTIONS == 'true' ) $params = 'class="productListing-data" width="'.((100/sizeof($column_list))*2).'%" colspan="2"'; $lc_align = 'center'; $button = $quantity_box . '<br />' . $button; $lc_text = $form . $buytable . (PRODUCT_LIST_OPTIONS == 'true' ? attribute_drop($listing['products_id'],$listing['products_tax_class_id']) . '</td><td align="center" class="productListing-data">' . $button : $button) . $buytableend; break; } $list_box_temp[] = array('align' => $lc_align, 'params' => $params, 'text' => $lc_text); } } else { $list_box_temp = array('params' => 'class="list-block"'); if (PRODUCT_LIST_IMAGE) { $list_box_temp[] = array('align' => 'center', 'params' => 'class="productListing-data" ', 'text' => $link . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], PRODUCT_IMAGE_WIDTH, PRODUCT_IMAGE_HEIGHT) . '</a>'); } $display =''; for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { $last = ($n == ($col +1)); switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $text = $listing['products_model']; $display .= ($last ? '' : $text . '<br />'); break; case 'PRODUCT_LIST_NAME': $text = $link.'<b><u>' . $listing['products_name'] . '</u></b></a>' . ($listing['short_desc'] && (PRODUCT_SHORT_DESC == 'true') ? '<br /><span class="short">' . $listing['short_desc'] . '</span>' : ''); $display .= ($last ? '' : $text . '<br />'); break; case 'PRODUCT_LIST_MANUFACTURER': $text = '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a>'; $display .= ($last ? '' : $text . '<br />'); break; case 'PRODUCT_LIST_PRICE': $text = ($last ? '' : '<br />Price: ') . '<span class="productListing-list-price">'; $price = (function_exists(display_short_price)) ? $currencies->display_short_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) : $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])); if (tep_not_null($listing['specials_new_products_price'])) { $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 { $text .= ($listing['products_price'] > 0 ? '' . $price : '' . TEXT_POA); if (function_exists(tep_get_att_price)) $display .= (tep_get_att_price($listing['products_id']) > 0 ? '+' : ' ') ; } $text .= '</span>' . ($last ? '' : '<br />'); $display .= ($last ? '' : $text . '<br />'); break; case 'PRODUCT_LIST_QUANTITY': $text = ($listing['products_quantity'] ? 'Stock = ' . $listing['products_quantity'] : 'Out of Stock'); $display .= ($last ? '' : $text . '<br />'); break; case 'PRODUCT_LIST_WEIGHT': $text = 'Weight = ' . $listing['products_weight'].WEIGHT_ABRV . ($last ? '' : '<br />'); $display .= ($last ? '' : $text . '<br />'); break; case 'PRODUCT_LIST_BUY_NOW': $button = $quantity_box . ($last ? '<br />' : ' ') . $button; $text = $form . $buytable . (PRODUCT_LIST_OPTIONS == 'true' ? '<div ' . ($last ? 'align="right"' : 'align="left"' ) . ' width="100%">' . attribute_drop($listing['products_id'],$listing['products_tax_class_id']) . '</div>' . $button : '<br />' . $button) . $buytableend; $display .= ($last ? '' : $text . '<br />'); break; } } $display .= ''; $list_box_temp[] = array('align' => 'left', 'params' => 'class="main" valign="top" ', 'text' => $display); $list_box_temp[] = array('align' => 'right', 'params' => 'class="productListing-data" valign="top" ', 'text' => $text); } return ($list_box_temp); } // function list_box_data end function attribute_drop($products_id,$tax_class_id) { global $languages_id; $currencies = new currencies(); $atrib_drop = ''; $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . (int)$products_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { $atrib_drop = '<table border="0" cellspacing="0" cellpadding="2">'; $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$products_id . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$products_id . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($tax_class_id)) .') '; } } $atrib_drop .= '<tr><td align="left" class="productListing-data" >' . $products_options_name['products_options_name'] . ':' . '</td><td align="left">' . tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array) . '</td></tr>'; } $atrib_drop .= '</table>'; } return $atrib_drop; } // function attribute_drop end // set initial values $thumbnail_view = (isset($_GET['list']) ? $_GET['list'] : PRODUCT_THUMBNAIL_VIEW); $empty_list=false; if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) { $title_name = tep_get_manufacturer_name($_GET['manufacturers_id']); } else { $title_name = (!$category['categories_name'] && tep_not_null($_GET['cPath']) ? tep_get_category_name(substr($_GET['cPath'], strpos($_GET['cPath'],'_')+1),$languages_id) : ''); } $grid = strstr(PRODUCT_THUMBNAIL_VIEW, 'grid'); $gborders = function_exists(mws_boxHeader);//$gborders = false; $Tborder = (!$gborders ? '<table class="infoBoxList" width="100%"><tr><td>' : mws_boxHeader('<big>'.$title_name.'</big>')); $Tborderend = (!$gborders ? '</td></tr></table>' : mws_boxFooter ()); $border2 = (!$gborders ? '<table class="infoBoxList" width="100%"><tr><td>' : ($graphic_bord == 'yes' ? mws_boxHeader('<big>'.$title_name.'</big>') : '')); $border2end = (!$gborders ? '</td></tr></table>' : ($graphic_bord == 'yes' ? mws_boxFooter() : '')); $form = tep_draw_form('cart_quantity', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action','products_id')) . 'action=add_product')); if (tep_not_null($_GET['categories_id']) && $current_category_id == 0) $current_category_id = $_GET['categories_id']; // output selected display if (strstr($thumbnail_view, 'thumbnails')) { //thumbnail $row = 0; $col = 0; $border = (!$grid ? '<table class="infoBoxProducts" cellpadding="2" width="'.PRODUCT_LIST_WIDTH.'" height="'.PRODUCT_LIST_HEIGHT.'" ><tr><td valign="top">' : '<br />'); $borderend = (!$grid ? '</td></tr></table>' : ''); $style = (!$grid ? 'class="smallText"' : 'class="infoBoxGrid"'); $info_box_contents = array(); if ($listing_split->number_of_rows > 0) { $listing_query = tep_db_query($listing_split->sql_query);} else { $listing_query = tep_db_query($listing_sql); } if (tep_db_num_rows($listing_query)) { while ($products = tep_db_fetch_array($listing_query)) { if ($row == 0) { if (!$gborders && !$grid) $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="'.(PRODUCTS_PER_ROW ? (100/PRODUCTS_PER_ROW) : '').'%" valign="top"', 'text' => ' '); echo $Tborder;$row ++; } // build thumb $man_id = (tep_not_null($_GET['manufacturers_id']) ? $_GET['manufacturers_id'] : ''); $link = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id'] . ($man_id ? '&manufacturers_id='.$man_id : ($cPath && $cat_path ? '&cPath=' . $cPath : ''))) . '"' . ($man_id || ($cat_path && $cat_path) ? ' rel="nofollow"' : '') . '>'; $quantity = (PRODUCT_LIST_QUANTITY_BOX == 'true' ? 'Quantity: ' . tep_draw_input_field('cart_quantity','1','maxlength="5" size="5"') . '<br />' : ''); $image = (file_exists(DIR_WS_IMAGES . $products['products_image']) ? $products['products_image'] : 'no-image.jpg'); $addimages = (file_exists(DIR_WS_CLASSES . 'displayimages.php')); // Additional Images Present if ($addimages) { $image_query = tep_db_query( "SELECT ai.medium_images, ai.images_description, ai.popup_images, p.products_image_med, p.products_image_description FROM " . TABLE_ADDITIONAL_IMAGES . " ai, " . TABLE_PRODUCTS . " p WHERE ai.products_id=p.products_id and ai.products_id = '".(int)$products['products_id']."'"); $selected_image = tep_db_fetch_array($image_query); $image = ($selected_image['medium_images'] ? $selected_image['medium_images'] : ($selected_image['products_image_med'] ? $selected_image['products_image_med'] : ($selected_image['popup_images'] ? $selected_image['popup_images'] : $products['products_image']))); } $image = (!$grid && $column_list[0] == 'PRODUCT_LIST_IMAGE' ? '<br />' : '') . $link . tep_image(DIR_WS_IMAGES . $image, ($addimages ? (tep_not_null($selected_image['images_description']) ? $selected_image['images_description'] : (tep_not_null($selected_image['products_image_description']) ? $selected_image['products_image_description'] : $products['products_name'])) : $products['products_name']), PRODUCT_IMAGE_WIDTH, PRODUCT_IMAGE_HEIGHT) . '</a>' . '<br />'; $buypic = (LISTING_BUTTON == 'buy now' ? 'button_in_cart.gif' : 'button_buy_now.gif'); $button = (LISTING_BUTTON != 'none' && PRODUCT_LIST_BUY_NOW ? (LISTING_BUTTON == 'buy now & details' ? '<br />' . tep_draw_hidden_field('products_id', $products['products_id']) . $quantity . tep_image_submit($buypic, IMAGE_BUTTON_BUY_NOW, 'class="thm_buy_now"') . ' <span class="buy_now">|</span> ' . $link . tep_image_button('button_details_small.gif', IMAGE_BUTTON_DETAILS, 'class="thm_buy_now"') . '</a><br /><br />' : (strstr(LISTING_BUTTON, 'buy now') ? '<br />' . tep_draw_hidden_field('products_id', $products['products_id']) . $quantity . tep_image_submit($buypic, IMAGE_BUTTON_BUY_NOW) . '<br /><br />' : '<br />'. $link . tep_image_button('button_details.gif', IMAGE_BUTTON_DETAILS) . '</a><br /><br />' )) : ' '); if ($products['products_price'] == 0) $button = (strstr(LISTING_BUTTON, 'details') ? '<br /><span class="buy_now"> </span>'. $link . tep_image_button('button_details_small.gif', IMAGE_BUTTON_DETAILS, 'class="thm_buy_now"') . '</a> <br />' : ''); $name = $link . '<b>' . $products['products_name'] . '</b>' . '</a><br />'. ($products['short_desc'] && (PRODUCT_SHORT_DESC == 'true') ? '<br />' . $products['short_desc'] . '<br />' : ''); $price = (function_exists(display_short_price)) ? $currencies->display_short_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id'])) : $currencies->display_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id'])); if (tep_not_null($products['specials_new_products_price'])) { $price = '<s>' . $currencies->display_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($products['specials_new_products_price'], tep_get_tax_rate($products['products_tax_class_id'])) . '</span>'; } if (function_exists(tep_get_att_price)) $price .= (tep_get_att_price($products['products_id']) > 0 ? '+' : '') ; if (isset($products['products_quantity']) && !$products['products_quantity']) $button = (strstr(LISTING_BUTTON, 'details') ? '<br /><span class="buy_now"> </span>'. $link . tep_image_button('button_details_small.gif', IMAGE_BUTTON_DETAILS, 'class="thm_buy_now"') . '</a> <br />' : ''); $show_price = '<br /><font size="'.PRODUCT_PRICE_SIZE.'">' . ($products['products_price'] > 0 ? $price : TEXT_POA) . '<br /></font>'; $quantity = ($products['products_quantity'] ? 'Stock = '.$products['products_quantity'] : 'Out of Stock').'<br />'; $weight = 'Weight = '.$products['products_weight'].WEIGHT_ABRV.'<br />'; $model = $products['products_model'] . '<br />'; $manfact = '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $products['manufacturers_id']) . '">' . $products['manufacturers_name'] . '</a><br />'; $display = $border; for ($disp=0, $n=sizeof($column_list); $disp<$n; $disp++) { switch ($column_list[$disp]) { case 'PRODUCT_LIST_IMAGE': $display .= '<table summary="" width="100%" ><tr><td style="text-align:center;" valign="middle" height="'.PRODUCT_IMAGE_VSPACE.'" >'.$image.'</td></tr></table>'; break; case 'PRODUCT_LIST_NAME': $extra_fields_text = ''; $extra_fields_query = tep_db_query(" SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef, ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf WHERE ptf.products_extra_fields_id=pef.products_extra_fields_id and ptf.products_id=". (int) $products['products_id'] ." and pef.languages_id=" . (int)$languages_id . " and ptf.products_extra_fields_value<>'' and pef.products_extra_fields_status <> 0 ORDER BY products_extra_fields_order"); while ($extra_fields = tep_db_fetch_array($extra_fields_query)) { $extra_fields_text .= '<tr><td class="smallText"><span class="xtra-field-name">' . $extra_fields['name'] . ': </span><span class="xtra-field-value">' . $extra_fields['value'] . '</span></td></tr>'; } $display .= '<table summary="" width="100%" ><tr><td class="thumbcontent" height="'.PRODUCT_NAME_VSPACE.'" >'.$name.'</td></tr>' . $extra_fields_text . '</table>'; break; case 'PRODUCT_LIST_MODEL': $display .= $model; break; case 'PRODUCT_LIST_MANUFACTURER': $display .= $manfact; break; case 'PRODUCT_LIST_PRICE': $display .= $show_price; break; case 'PRODUCT_LIST_QUANTITY': $display .= $quantity; break; case 'PRODUCT_LIST_WEIGHT': $display .= $weight; break; } } $display .= $borderend . $form . '<br />' . (PRODUCT_LIST_OPTIONS == 'true' ? attribute_drop($products['products_id'],$products['products_tax_class_id']) . $button : $button) . '</form>'; // thumb built $info_box_contents[$row][$col] = array('align' => 'center', 'params' => $style . ' width="'.(PRODUCTS_PER_ROW ? (100/PRODUCTS_PER_ROW) : '').'%" valign="top"', 'text' => $display ); $col ++; if ($col > PRODUCTS_PER_ROW-1) { $col = 0; $row ++; } } // prod loop } else {$empty_list=true; }// no products!! // got display if ($row) { $i = 0 ; $nbx = class_exists(noborderBox); if ($col > 0 && $row > 1 && $nbx && !$grid) { for ($i=0, $n=$col; $i < $n; $i++) { $last_row[0][$i] = $info_box_contents[$row][$i]; unset($info_box_contents[$row][$i]); } } if (!$i) {$col = 0;$row ++;$info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="'.(PRODUCTS_PER_ROW ? (100/PRODUCTS_PER_ROW) : '').'%" ', 'text' => ' '); } if ($nbx) new noborderBox($info_box_contents); else new contentBox($info_box_contents); if($i) new noborderBox($last_row); echo $Tborderend; } else {$empty_list=true; } } elseif (strstr($thumbnail_view, 'manufacturer')) { //manufacturer $row = 0;$col = 0; if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) { $filterlist_sql= tep_db_query("select distinct m.manufacturers_id, m.manufacturers_name, mi.manufacturers_description from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on m.manufacturers_id = mi.manufacturers_id where m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' and mi.languages_id = '" . (int)$languages_id . "'"); }else{ $filterlist_sql= tep_db_query("select distinct m.manufacturers_id, m.manufacturers_name, mi.manufacturers_description from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on m.manufacturers_id = mi.manufacturers_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' and mi.languages_id = '" . (int)$languages_id . "' order by m.manufacturers_name"); } if (tep_db_num_rows($filterlist_sql)) { $rows = 0; while ($manufacturer = tep_db_fetch_array($filterlist_sql)) { $info_box_heading = array(); if ($rows) echo tep_draw_separator('pixel_trans.gif', '100%', '4'); echo $border2; $info_box_heading[0] = array('text' => '<big>'.$manufacturer['manufacturers_name'].'</big><br />'.(MANU_DESCRIPTION == 'true' ? $manufacturer['manufacturers_description'].'<br />' : '')); new infoBoxHeading($info_box_heading, false, false); //echo tep_draw_separator('pixel_trans.gif', '100%', '2'); $list_box_contents = array(); $list_box_contents[0] = (LISTING_HEADINGS == 'true' && !strstr(PRODUCT_THUMBNAIL_VIEW, 'block') ? list_box_head($column_list) : ''); if ($listing_split->number_of_rows > 0) { $rows = 0; $listing_query = tep_db_query($listing_split->sql_query);} else { $rows = 0; $listing_query = tep_db_query($listing_sql); } while ($listing = tep_db_fetch_array($listing_query)) { if ($listing['manufacturers_id'] != $manufacturer['manufacturers_id']) continue; $list_box_contents[][] = array('text' => '<br />'); if (!$rows && $gborders) $list_box_contents = array(); $rows++; $cur_row = sizeof($list_box_contents); $list_box_contents[$cur_row] = list_box_data($listing, $column_list); for ($x=0, $n=sizeof($list_box_contents[$cur_row]); $x<$n; $x++) { $list_box_contents[$cur_row+1][$x] = array('align' => 'center', 'params' => 'class="separator" ', 'text' => '<br />'); } } $list_box_contents[$cur_row+1] = array(array('text' => '<br />')); if (!$rows && isset($_GET['manufacturers_id'])) { $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); $rows++; } if ($rows) new productListingBox($list_box_contents); echo $border2end; } // man loop; $col = 0;$row ++;$info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => ' '); } else {$empty_list=true; } // no manufacturers!! } if ((!strstr($thumbnail_view, 'thumbnails') && !strstr($thumbnail_view, 'manufacturer')) || $empty_list) { //default listing if (MANU_DESCRIPTION == 'true' && tep_not_null($_GET['manufacturers_id'])) { $manufacturer_query = tep_db_query("select manufacturers_description from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int)($_GET['manufacturers_id']) . "' and languages_id = '" . (int)$languages_id . "'"); $manufacturer = tep_db_fetch_array($manufacturer_query); } $info_box_heading[0] = array('text' => '<big>'.$title_name.'</big>'.($manufacturer['manufacturers_description'] ? '<br />' . $manufacturer['manufacturers_description'] : '')); $list_box_contents = array(); $list_box_contents[0] = (LISTING_HEADINGS == 'true' && !strstr(PRODUCT_THUMBNAIL_VIEW, 'block') ? list_box_head($column_list) : ''); 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)) { $list_box_contents[][] = array('text' => '<br />'); if (!$rows && $gborders) $list_box_contents = array(); $rows++; $cur_row = sizeof($list_box_contents); $list_box_contents[$cur_row] = list_box_data($listing, $column_list); for ($x=0, $n=sizeof($list_box_contents[$cur_row]); $x<$n; $x++) { $list_box_contents[$cur_row+1][$x] = array('align' => 'center', 'params' => 'class="separator" ', 'text' => '<br />'); } } $list_box_contents[$cur_row+1] = array(array('text' => '<br />')); $empty_list = false; echo $border2; if ($title_name) new infoBoxHeading($info_box_heading, false, false); new productListingBox($list_box_contents); echo $border2end; //tep_draw_separator('pixel_trans.gif', '100%', '4'); } 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 ($base_nav && !$empty_list) echo $drop; if (($listing_split->number_of_rows > (int)$max_results) && $base_nav) echo $page_nav; if (!strstr(PRODUCT_THUMBNAIL_VIEW, 'list') && LISTING_SWITCH != 'false' && !$empty_list) echo '<br /><span class="smalltext"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('list')). 'list='.(strstr($thumbnail_view, 'thumbnails') ? 'manufacturer' : 'thumbnails')) . '">' . (strstr($thumbnail_view, 'thumbnails') ? LIST_VIEW : THUMB_VIEW).'</a></span><br /><br />'; // echo '<hr>' . $listing_sql . '<hr>'; ?> It's odd that it's not throwing any codes AND not doing anything visible at all. I noticed something in your new code, the $extra_fields_text = ''; In my new_products.php which is working right, there is a "" as opposed to ''. Not sure if that matters. I also notice that you have changed some of the names of the variables, I'm sure this is intended by you, though. I feel like we're very close to getting it. -Justin Quote Link to comment Share on other sites More sharing options...
spooks Posted October 22, 2009 Author Share Posted October 22, 2009 I would suspect the that unfortunatly it does need the join, so try the sql with the join back in: SELECT 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) $products['products_id'] ." and pef.languages_id=" . (int)$languages_id . " and ptf.products_extra_fields_value<>'' and pef.products_extra_fields_status <> 0 ORDER BY pef.products_extra_fields_order"); variable can be named whatever u want, u must just be consistant. the only other possibility is I havent cheked what states products_extra_fields_status has Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al. Link to comment Share on other sites More sharing options...
dremhmrk2 Posted October 22, 2009 Share Posted October 22, 2009 I would suspect the that unfortunatly it does need the join, so try the sql with the join back in: SELECT 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) $products['products_id'] ." and pef.languages_id=" . (int)$languages_id . " and ptf.products_extra_fields_value<>'' and pef.products_extra_fields_status <> 0 ORDER BY pef.products_extra_fields_order"); variable can be named whatever u want, u must just be consistant. the only other possibility is I havent cheked what states products_extra_fields_status has Spooks, I changed the specified lines of code, same exact problem. NOTHING happens, haha. This is a bit frustrating. I tried finding a support thread for Product Extra Fields contrib but I cannot find anything helpful. The only difference I really see, is that in my new_products.php, the defining of the variables takes place in it's on <?php> tag and the info is being ECHO'd in a unique <?php> tag as well. Here's my new_products.php file again. This works, so it has to hold the answer, somehow. <style> a { border: none; border-top-style: none; color:#000000; } </style> <?php $info_box_contents = array(); $i = 0; $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B'))); //new contentBoxHeading($info_box_contents); /*if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); } else { */ $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by rand() limit " . MAX_DISPLAY_NEW_PRODUCTS); // } $row = 0; $col = 0; $info_box_contents = array(); while ($new_products = tep_db_fetch_array($new_products_query)) { $new_products['products_name'] = tep_get_products_name($new_products['products_id']); $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="" width="" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a>', 'text1' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>', 'text2' => $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])), 'text3' => $new_products['products_id']); $col ++; if ($col > 2) { $col = 0; $row ++; } } ?> <tr> <td width="100%"> <p> </p> <p align="center"><strong>Welcome to Topper Liquidators!</strong></p> <p> </p> </td> </tr> <table class="" border="0" cellspacing="0" cellpadding="0"> <tr> <?php foreach($info_box_contents as $contents) { //print_r($contents); foreach($contents as $newCont) : /*print_r($contents[0]['text']); print_r($contents[1]['text']); print_r($contents[2]['text']); print_r($contents[3]['text']); die;*/ ?> <?php // START: Extra Fields Contribution v2.0b - mintpeel display fix $extra_field_value = ""; $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)$newCont['text3']." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".(int)$languages_id."') ORDER BY products_extra_fields_order"); $extra_fields = tep_db_fetch_array($extra_fields_query); $extra_field_name = $extra_fields['name']; if($extra_fields['value'] != "") $extra_field_value = stripslashes($extra_fields['value']); ?><td> <!-- products table starts here --><table class="list" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan='2' class="leftpad"><h2> <?php echo htmlspecialchars_decode(stripslashes($newCont['text'])); ?> </h2></td></tr> <tr> <td rowspan="2" valign="top" class="productimg"> <?php echo $newCont['text1']; ?> <?php echo '<br/><font size="2" color="#ff0000"><b>' . $extra_field_value .'</b></font>';?></td> <td align="left" class="rightpad"> </td> </tr> <tr> <td valign="bottom" align="right" class="rightpad"><br /> <br /> <span class="red"> </span></td> </tr> <tr> <td align="left" colspan='2' class="leftpad"><span class="btn_img"> </span><span style="padding:0 35px 0 45px"><span class="size22"> </span> <?php if(substr($newCont['text2'],0,1) != "$"){ ?> <span class="size12"><?php echo $newCont['text2']; ?></span> <?php } else{ ?> <span class="size35"><font size="2">Price: </font><?php echo $newCont['text2']; ?></span><?php } ?><span class="size22"></span></span></td> </tr> </table><!-- products table ends here --></td> <?php $i++; if($i % 4 == 0) echo "</tr><tr>"; endforeach; } ?> </table> <?php //new contentBox($info_box_contents); ?> The battle continues. Quote Link to comment Share on other sites More sharing options...
spooks Posted October 23, 2009 Author Share Posted October 23, 2009 I really don't like looking at that file, the code is so messy!! The issue is simply the data is not getting pulled yet, I suspect my assumptions on the status is wrong try this sql: SELECT 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) $products['products_id'] ." and pef.languages_id=" . (int)$languages_id . " and ptf.products_extra_fields_value<>'' and pef.products_extra_fields_status ORDER BY pef.products_extra_fields_order"); if that does work, try this, without joins again. SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef, ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf WHERE ptf.products_extra_fields_id=pef.products_extra_fields_id and ptf.products_id=". (int) $products['products_id'] ." and pef.languages_id=" . (int)$languages_id . " and ptf.products_extra_fields_value<>'' and pef.products_extra_fields_status ORDER BY pef.products_extra_fields_order"); Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al. Link to comment Share on other sites More sharing options...
spooks Posted October 23, 2009 Author Share Posted October 23, 2009 I just spotted its not using languages in the correct way, that could cause problems. So u may need: SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef, ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf WHERE ptf.products_extra_fields_id=pef.products_extra_fields_id and ptf.products_id=". (int) $products['products_id'] ." and (pef.languages_id = '0' or pef.languages_id = '".(int)$languages_id."') and ptf.products_extra_fields_value<>'' and pef.products_extra_fields_status ORDER BY pef.products_extra_fields_order"); Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al. 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.