Latest News: (loading..)

confusedcart

Members
  • Content count

    82
  • Joined

  • Last visited

About confusedcart

Profile Information

  • Real Name
    Ahmed
  1. Hi guys, I need to know if there is a contribution that can place a countdown timer on a specific product at the product listings page. Like a sale lasting 5 days you have a countdown timer saying how much time is left to buy the product at that price. This seems to be the in thing with some private sales websites like www.secretsales.com etc. Is the a contrib for this anywhere??
  2. Hi Jim, Contrib works great. Just having trouble integrating with Fetured Products. Code is slightly different. PLease have a look. Can't get the databse query right: if ( (!isset($featured_products_category_id)) || ($featured_products_category_id == '0') ) { $featured_products_query = tep_db_query("select p.products_date_added, p.products_id, pi.image_filename, 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 left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS); } else { $featured_products_query = tep_db_query("select p.products_date_added, 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_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) left join " . TABLE_FEATURED . " f on p.products_id = f.products_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where c.parent_id = '" . $featured_products_category_id . "' and p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS); } $row = 0; $col = 0; echo ' <table cellspacing=0 cellpadding=0> <tr> '; while ($featured_products = tep_db_fetch_array($featured_products_query)) { $featured_products['products_name'] = tep_get_products_name($featured_products['products_id']); // added for New Product Icon contribution // 2592000 = 30 days in the unix timestamp format if ( ($today_time - strtotime($featured_products['products_date_added'])) < 2592000) { $featured_products['products_name'] .= '<br>' . tep_image_button('icon_newarrival.gif', TEXT_ICON_NEW_PRODUCT); } // end addition $product_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$featured_products['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); $product = tep_db_fetch_array($product_query); $featured_products['products_description'] = $product['products_description']; // get products category $categories_query = tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$featured_products['products_id'] . "'"); if (tep_db_num_rows($categories_query) > 0) { $categories = tep_db_fetch_array($categories_query); $categories_query2 = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$categories['categories_id'] . "'"); $categories2 = tep_db_fetch_array($categories_query2); $category_name = $categories2['categories_name']; } else { $category_name = ''; } // get products manufacturers $man_query = tep_db_query("select manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$featured_products['products_id'] . "'"); if (tep_db_num_rows($categories_query) > 0) { $manuf = tep_db_fetch_array($man_query); $man_query2 = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$manuf['manufacturers_id'] . "'"); $manuf2 = tep_db_fetch_array($man_query2); $man_name = $manuf2['manufacturers_name']; } else { $man_name = ''; } echo ' <td width=140 valign=top style="padding-left: 9px"> <table cellspacing=0 cellpadding=0 width=160> <tr><td height=13></td></tr> <td width=87 valingn=top> <table cellspacing=0 cellpadding=8px> <td width=73 valign=top><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['image_filename'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'vspace=0') . '</a></td> <tr><td><a class="pr_name" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '"> ' . $featured_products['products_name'] . '</a></td></tr> <tr><td><span class=ch6>only:</span> <span class=ch7>'.$currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])).'</span></td></tr> </table> </td></tr> <tr><td height=14></td></tr> <tr><td colspan=2 style="padding-left: 12px"><a href="' . tep_href_link('product_info.php','products_id=' . $featured_products['products_id']) . '">' . tep_image_button('small_view.gif') . '</a><span style="padding-left: 6px"></span><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products['products_id']) . '">' . tep_image_button('button_in_cart.gif') . '</a></td></tr> <tr><td height=15></td></tr> </table> </td> ';
  3. PLEASE CHECK UR PRIVATE MESSAGES URGENTLY!
  4. or even a more pics 6 classic with CSS box.. just adding a CSS box to tht with thumbnails.. that way I can have subdirectories too??
  5. Here is the direct link to how their watches are displayed: http://www.watchesshop.com/products/AQ13.3...x-Set-6370.html Mine is looking veru similar, I have the same CSS box working. Only when I click the thumbnail I can't get a popup which I desperately need for the closeups. You can see they have the same closeups which are too large for the CSS box. PLEASE Jim, do this for me.. I don't have any other options. Yours is the best contrib on OSc..
  6. Is there no way to get it to function as that both the CSS and popup can be used?? Because I need CSS, but some images are way too big to fit the CSS box and needs a popup. Can you do this for me?? I know it takes time and effort and I'm willing to pay for it. since this function I have to have!! I have some supersized images, some 600x600!! And the subdirectory thing?? I'm not sure if it helps, but MorePics Classic worls like that and that was good for not having too many images stored in the images directory especially if you have many products.. Let me know if you can help. Like I said, I know it's asking for your time so I will pay for it.. don't have any other option since this is the best contrib that comes with an image box :(( If you look at www.watchesshop.com >> they have what I need.. Popup and CSS!!
  7. All i need is for the thumbnails to open the popup when clicked. i'm only going to use the CSS box, it will never be turned off so all I need is a popup zoom feature for the CSS box.. And I'm trying to mod it myself, i just can't get it right :(
  8. I think maybe the popup is not supposed to work when the Image Box CSS is enabled.. How do I get both the popup and Image Box to work together. Like I mentioned Jim, I can't write the code. I will really appreciate your help on this!! PLEASE help me!!
  9. Tried and tried but cannot get the popup to work when the CSS thumbnails are present. Double checked the code. Its all correct: <?php if (MORE_PICS_LINK_CSS_IMAGES == 'true') { echo '<a href="' . tep_href_link (FILENAME_POPUP_IMAGE, tep_get_all_get_params() . '#morepics') . '">' . tep_image (DIR_WS_IMAGES . $products_main_image, $product_info['products_name'], (MORE_PICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MORE_PICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_HEIGHT), 'hspace="5" vspace="5"') . '<br><img border=0 src=images/zoom.gif></a>'; } else { ?> <script language="javascript"><!-- document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $products_main_image, addslashes($product_info['products_name']), (MORE_PICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MORE_PICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_HEIGHT), 'hspace="5" vspace="5"') . '<br><img border=0 src=images/zoom.gif></a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link (DIR_WS_IMAGES . $products_main_image) . '" target="_blank">' . tep_image (DIR_WS_IMAGES . $products_main_image, $product_info['products_name'], (MORE_PICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MORE_PICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_HEIGHT), 'hspace="5" vspace="5"') . '<br><img border=0 src=images/zoom.gif></a>'; ?> </noscript> <?php } // if (MORE_PICS_LINK_CSS_IMAGES ... else ... // EOF: More Pics ?>
  10. More notes.. With More Pics 6 Classic you could choose the image subdirectory.. I noticed you can't with the advanced.. All images get saves under the shop/images/ directory.. so can't have for example a shop/images/watches directory to store the images.. is there a way to incorporate subdirectories?? Also when creating a product and when you're previewing it. you can't preview you image obviously and it shows up as one of those empty blocks. is there a way to remove the image when previewing the product before listing. because the preview still expects the image from the old osc.. The main issue is the subdirectory -- if you have tons of products it would be useful if you could save images in different folders. this was possible in the standard more pics.. as you know, i'm too too good creating code etc. can you tweak it to get subdirectories??
  11. JIM EVEN XSELL IS WORKING 100% NOW.. ALL I HAD TO DO WAS ADD A NEW PRODUCT, SO THATS' SORTED.. BUT I'm still having trouble with the popup.. I have a the main image with smaller thumbnails below it.. That works fine, but when I click a thumbnail it goes to an entire new product_info.php page for the same product. And that error message on the bottom pops up like I mentioned before. However, in the More Pics settings, when I set: Show original image on productinfo page >>> true & Use CSS Images instead of popup >>> false And I then click that original image.. the popup works fine.. But it doesn't work when I click the smaller thumbnail icons.. I also don't get a zoom button image under the thumbnails, but I do for the ''original image'' setting under that image. Not sure why it's doing this just for the thumbnails!!
  12. Ws thinking, maybe its a problem in admin/xsell.php -- I tried tweaking the code similar to the catalogue side for the database queries. No luck.. Need your expertise. Check the code beow for admin/xsell.php : <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2002 osCommerce Released under the GNU General Public License xsell.php Image Fix by Xpdream.com Original Idea From Isaac Mualem im@imwebdesigning.com <mailto:im@imwebdesigning.com> Complete Recoding From Stephen Walker admin@snjcomputers.com */ require('includes/application_top.php'); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); switch($_GET['action']){ case 'update_cross' : if ($_POST['product']){ foreach ($_POST['product'] as $temp_prod){ tep_db_query('delete from ' . TABLE_PRODUCTS_XSELL . ' where xsell_id = "'.$temp_prod.'" and products_id = "'.$_GET['add_related_product_ID'].'"'); } } $sort_start_query = tep_db_query('select sort_order from ' . TABLE_PRODUCTS_XSELL . ' where products_id = "'.$_GET['add_related_product_ID'].'" order by sort_order desc limit 1'); $sort_start = tep_db_fetch_array($sort_start_query); $sort = (($sort_start['sort_order'] > 0) ? $sort_start['sort_order'] : '0'); if ($_POST['cross']){ foreach ($_POST['cross'] as $temp){ $sort++; $insert_array = array(); $insert_array = array('products_id' => $_GET['add_related_product_ID'], 'xsell_id' => $temp, 'sort_order' => $sort); tep_db_perform(TABLE_PRODUCTS_XSELL, $insert_array); } } $messageStack->add(CROSS_SELL_SUCCESS, 'success'); break; case 'update_sort' : foreach ($_POST as $key_a => $value_a){ tep_db_query('update ' . TABLE_PRODUCTS_XSELL . ' set sort_order = "' . $value_a . '" where xsell_id = "' . $key_a . '"'); } $messageStack->add(SORT_CROSS_SELL_SUCCESS, 'success'); break; } ?> <!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 TITLE; ?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> <style> .productmenutitle{ cursor:pointer; margin-bottom: 0px; background-color:orange; color:#FFFFFF; font-weight:bold; font-family:ms sans serif; width:100%; padding:3px; font-size:12px; text-align:center; /*/*/border:1px solid #000000;/* */ } .productmenutitle1{ cursor:pointer; margin-bottom: 0px; background-color: red; color:#FFFFFF; font-weight:bold; font-family:ms sans serif; width:100%; padding:3px; font-size:12px; text-align:center; /*/*/border:1px solid #000000;/* */ } </style> <script language="JavaScript1.2"> function cOn(td) { if(document.getElementById||(document.all && !(document.getElementById))) { td.style.backgroundColor="#CCCCCC"; } } function cOnA(td) { if(document.getElementById||(document.all && !(document.getElementById))) { td.style.backgroundColor="#CCFFFF"; } } function cOut(td) { if(document.getElementById||(document.all && !(document.getElementById))) { td.style.backgroundColor="DFE4F4"; } } </script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <td width="100%" valign="top"> <!-- body_text //--> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10');?></td> </tr> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '15');?></td> </tr> </table> <?php if ($_GET['add_related_product_ID'] == ''){ ?> <table border="0" cellspacing="1" cellpadding="2" bgcolor="#999999" align="center"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" width="75"><?php echo TABLE_HEADING_PRODUCT_ID;?></td> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCT_MODEL;?></td> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCT_NAME;?></td> <td class="dataTableHeadingContent" nowrap><?php echo TABLE_HEADING_CURRENT_SELLS;?></td> <td class="dataTableHeadingContent" colspan="2" nowrap align="center"><?php echo TABLE_HEADING_UPDATE_SELLS;?></td> </tr> <?php $products_query_raw = 'select p.products_id, p.products_model, pd.products_name, p.products_id from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by p.products_id asc'; $products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows); $products_query = tep_db_query($products_query_raw); while ($products = tep_db_fetch_array($products_query)) { ?> <tr onMouseOver="cOn(this); this.style.cursor='pointer'; this.style.cursor='hand';" onMouseOut="cOut(this);" bgcolor='#DFE4F4' onClick=document.location.href="<?php echo tep_href_link(FILENAME_XSELL_PRODUCTS, 'add_related_product_ID=' . $products['products_id'], 'NONSSL');?>"> <td class="dataTableContent" valign="top"> <?php echo $products['products_id'];?> </td> <td class="dataTableContent" valign="top"> <?php echo $products['products_model'];?> </td> <td class="dataTableContent" valign="top"> <?php echo $products['products_name'];?> </td> <td class="dataTableContent" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php $products_cross_query = tep_db_query('select p.products_id, p.products_model, pd.products_name, p.products_id, x.products_id, x.xsell_id, x.sort_order, x.ID from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd, '.TABLE_PRODUCTS_XSELL.' x where x.xsell_id = p.products_id and x.products_id = "'.$products['products_id'].'" and p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by x.sort_order asc'); $i=0; while ($products_cross = tep_db_fetch_array($products_cross_query)){ $i++; ?> <tr> <td class="dataTableContent"> <?php echo $i . '. <b>' . $products_cross['products_model'] . '</b> ' . $products_cross['products_name'];?> </td> </tr> <?php } if ($i <= 0){ ?> <tr> <td class="dataTableContent"> -- </td> </tr> <?php }else{ ?> <tr> <td class="dataTableContent"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10');?></td> </tr> <?php } ?> </table></td> <td class="dataTableContent" valign="top"> <a href="<?php echo tep_href_link(FILENAME_XSELL_PRODUCTS, tep_get_all_get_params(array('action')) . 'add_related_product_ID=' . $products['products_id'], 'NONSSL');?>"><?php echo TEXT_EDIT_SELLS;?></a> </td> <td class="dataTableContent" valign="top" align="center"> <?php echo (($i > 0) ? '<a href="' . tep_href_link(FILENAME_XSELL_PRODUCTS, tep_get_all_get_params(array('action')) . 'sort=1&add_related_product_ID=' . $products['products_id'], 'NONSSL') .'">'.TEXT_SORT.'</a> ' : '--')?></td> </tr> <?php } ?> <tr> <td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="infoBoxContent"> <tr> <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID', 'action'))); ?></td> </tr> </table></td> </tr> </table> <?php }elseif($_GET['add_related_product_ID'] != '' && $_GET['sort'] == ''){ $products_name_query = tep_db_query('select pd.products_name, p.products_model, p.products_image from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = "'.$_GET['add_related_product_ID'].'" and p.products_id = pd.products_id and pd.language_id ="'.(int)$languages_id.'"'); $products_name = tep_db_fetch_array($products_name_query); ?> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#999999" align="center"> <tr> <td><?php echo tep_draw_form('update_cross', FILENAME_XSELL_PRODUCTS, tep_get_all_get_params(array('action')) . 'action=update_cross', 'post');?><table cellpadding="1" cellspacing="1" border="0"> <tr> <td colspan="6"><table cellpadding="3" cellspacing="0" border="0" width="100%"> <tr class="dataTableHeadingRow"> <td valign="top" align="center" colspan="2"><span class="pageHeading"><?php echo TEXT_SETTING_SELLS.$products_name['products_name'].' ('.TEXT_MODEL.': '.$products_name['products_model'].') ('.TEXT_PRODUCT_ID.': '.$_GET['add_related_product_ID'].')';?></span></td> </tr> <tr class="dataTableHeadingRow"> <td align="center"><?php echo tep_image(DIR_WS_CATALOG_IMAGES.$products_name['products_image'], 'width="100" height="100"');?></td></tr> <tr> <td align="center" valign="bottom"><br><?php echo tep_image_submit('button_update.gif') . '<br><br><a href="'.tep_href_link(FILENAME_XSELL_PRODUCTS, 'men_id=catalog').'">' . tep_image_button('button_cancel.gif') . '</a>';?></td> </tr> </table></td> </tr> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" width="75"> <?php echo TABLE_HEADING_PRODUCT_ID;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_MODEL;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_IMAGE;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_CROSS_SELL_THIS;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_NAME;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_PRICE;?> </td> </tr> <?php $products_query_raw = 'select p.products_id, p.products_model, p.products_image, p.products_price, pd.products_name, p.products_id from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by p.products_id asc'; $products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows); $products_query = tep_db_query($products_query_raw); while ($products = tep_db_fetch_array($products_query)) { $xsold_query = tep_db_query('select * from '.TABLE_PRODUCTS_XSELL.' where products_id = "'.$_GET['add_related_product_ID'].'" and xsell_id = "'.$products['products_id'].'"'); ?> <tr bgcolor='#DFE4F4'> <td class="dataTableContent" align="center"> <?php echo $products['products_id'];?> </td> <td class="dataTableContent" align="center"> <?php echo $products['products_model'];?> </td> <td class="dataTableContent" align="center"> <?php echo ((is_file(DIR_FS_CATALOG_IMAGES.$products['products_image'])) ? tep_image(DIR_WS_CATALOG_IMAGES.$products['products_image'], 'width="100" height="100"') : '<br>No Image<br>');?><span class="konk2"></span> </td> <td class="dataTableContent"> <?php echo tep_draw_hidden_field('product[]', $products['products_id']) . tep_draw_checkbox_field('cross[]', $products['products_id'], ((tep_db_num_rows($xsold_query) > 0) ? true : false), '', ' onMouseOver="this.style.cursor=\'hand\'"');?> <label onMouseOver="this.style.cursor='hand'"><?php echo TEXT_CROSS_SELL;?></label> </td> <td class="dataTableContent"> <?php echo $products['products_name'];?> </td> <td class="dataTableContent"> <?php echo $currencies->format($products['products_price']);?> </td> </tr> <?php } ?> </table></form></td> </tr> <tr> <td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="infoBoxContent"> <tr> <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?></td> <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID', 'action'))); ?></td> </tr> </table></td> </tr> </table> <?php }elseif($_GET['add_related_product_ID'] != '' && $_GET['sort'] != ''){ $products_name_query = tep_db_query('select pd.products_name, p.products_model, p.products_image from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = "'.$_GET['add_related_product_ID'].'" and p.products_id = pd.products_id and pd.language_id ="'.(int)$languages_id.'"'); $products_name = tep_db_fetch_array($products_name_query); ?> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#999999" align="center"> <tr> <td><?php echo tep_draw_form('update_sort', FILENAME_XSELL_PRODUCTS, tep_get_all_get_params(array('action')) . 'action=update_sort', 'post');?><table cellpadding="1" cellspacing="1" border="0"> <tr> <td colspan="6"><table cellpadding="3" cellspacing="0" border="0" width="100%"> <tr class="dataTableHeadingRow"> <td valign="top" align="center" colspan="2"><span class="pageHeading"><?php echo TEXT_SETTING_SELLS.': '.$products_name['products_name'].' ('.TEXT_MODEL.': '.$products_name['products_model'].') ('.TEXT_PRODUCT_ID.': '.$_GET['add_related_product_ID'].')';?></span></td> </tr> <tr class="dataTableHeadingRow"> <td align="right"><?php echo tep_image(DIR_WS_CATALOG_IMAGES.$products_name['products_image']);?></td> <td align="right" valign="bottom"><?php echo tep_image_submit('button_update.gif') . '<br><br><a href="'.tep_href_link(FILENAME_XSELL_PRODUCTS, 'men_id=catalog').'">' . tep_image_button('button_cancel.gif') . '</a>';?></td> </tr> </table></td> </tr> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_ID;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_MODEL;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_IMAGE;?> </td> <td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_PRODUCT_NAME;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_PRICE;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_SORT;?> </td> </tr> <?php $products_query_raw = 'select p.products_id as products_id, p.products_price, p.products_image, p.products_model, pd.products_name, p.products_id, x.products_id as xproducts_id, x.xsell_id, x.sort_order, x.ID from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd, '.TABLE_PRODUCTS_XSELL.' x where x.xsell_id = p.products_id and x.products_id = "'.$_GET['add_related_product_ID'].'" and p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by x.sort_order asc'; $products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows); $sort_order_drop_array = array(); for($i=1;$i<=$products_query_numrows;$i++){ $sort_order_drop_array[] = array('id' => $i, 'text' => $i); } $products_query = tep_db_query($products_query_raw); while ($products = tep_db_fetch_array($products_query)){ ?> <tr bgcolor='#DFE4F4'> <td class="dataTableContent" align="center"> <?php echo $products['products_id'];?> </td> <td class="dataTableContent" align="center"> <?php echo $products['products_model'];?> </td> <td class="dataTableContent" align="center"> <?php echo ((is_file(DIR_FS_CATALOG_IMAGES.$products['products_image'])) ? tep_image(DIR_WS_CATALOG_IMAGES.$products['products_image'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) : '<br>'.TEXT_NO_IMAGE.'<br>');?> </td> <td class="dataTableContent" align="center"> <?php echo $products['products_name'];?> </td> <td class="dataTableContent" align="center"> <?php echo $currencies->format($products['products_price']);?> </td> <td class="dataTableContent" align="center"> <?php echo tep_draw_pull_down_menu($products['products_id'], $sort_order_drop_array, $products['sort_order']);?> </td> </tr> <?php } ?> </table></form></td> </tr> <tr> <td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="infoBoxContent"> <tr> <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID', 'action'))); ?></td> </tr> </table></td> </tr> </table> <?php } ?> <!-- body_text_eof //--> </td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  13. Jim I tried it, it still doesn't work, my code looks like this now. What it does is it takes random products from a category and fills it into a recommended products field. the db query i'm not sure is pulling the image_filename into the code. So there's no image displayed. I tried comparing this code with also_purchased_products.php -- it seems fine. But I cannot understand why it's not displaying!! This the code that will display the image (the entire code is below): <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['image_filename'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . ' This is not getting the image from the database: tep_image(DIR_WS_IMAGES . $xsell['image_filename'], FULL CODE BELOW: PLEASE HELP ME JIM.. SORRY ABOUT THE TROUBLE.. /* fill the box with all random products from the same category */ $mtm= rand(); $xsell_cat_query = tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "'"); $xsell_cat_array = tep_db_fetch_array($xsell_cat_query); $xsell_category = $xsell_cat_array['categories_id']; $new_limit = MAX_DISPLAY_ALSO_PURCHASED - $num_products_xsell; $xsell_prod_query = tep_db_query("select distinct p.products_id, pi.image_filename, pd.products_name, 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 . " pc, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_IMAGES . " pi on pd.products_id = pi.products_id and pi.product_page = '1' where pc.categories_id = '" . $xsell_category . "' and pc.products_id = p.products_id and p.products_id != '" . $HTTP_GET_VARS['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_status = '1' order by rand($mtm) desc limit " . MAX_DISPLAY_ALSO_PURCHASED); while ($xsell = tep_db_fetch_array($xsell_prod_query)) { $xsell['products_name'] = tep_get_products_name($xsell['products_id']); echo ' <td width=174 valign=top style="padding-left: 3px"> <table cellspacing=0 cellpadding=0 width=160> <tr><td height=13></td></tr> <td width=87 valingn=top> <table cellspacing=0 cellpadding=8> <td width=73 valign=top><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['image_filename'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td> </table>
  14. if we modify admin/categories.php such that we can sill have the old osc image function available. that me a work around all other contribs built without morepics in mind?? like xsell.. can that be done??