Guest Posted February 15, 2006 Posted February 15, 2006 I have an OSC template store that is installed and I wish to use this contribution, however, the files are slightly different....the main problem is this.... in the file catalog/includes/modules/new_products.php it says to look for: $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<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><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id']))); and replace with: if($new_products['products_price']<$new_products['products_map']){ $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<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><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br><a href="' . tep_href_link(FILENAME_CALL_FOR_PRICE, 'products_id=' . $new_products['products_id']) . '">' . CLICK_FOR_PRICE . '</a>'); }else{ $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<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><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id']))); } problem is....nothing even close to that exists on my version...here it is: <?php /* edited - 2005/07/01 13:50 ----------------------------------------- $Id: new_products.php,v 1.34 2003/06/09 22:49:58 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ ?> <!-- new_products //--> <?php 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 p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); } $row = 0; $col = 0; echo ' <table cellspacing=0 cellpadding=0> <tr><td background=images/m27.gif width=503 height=36> <table cellspacing=0 cellpadding=0> <tr><td colspan=2 height=10></td></tr> <tr><td width=52></td><td class=tx3>FEATURED PRODUCTS</td></tr> <tr><td colspan=2 height=8></td></tr> </table> </td></tr> <tr><td class=bg1> <table cellspacing=0 cellpadding=0 align=center width=500> <tr><td bgcolor=#ffffff height=10 colspan=2></td></tr> <tr> '; while ($new_products = tep_db_fetch_array($new_products_query)) { $new_products['products_name'] = tep_get_products_name($new_products['products_id']); $product_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$new_products['products_id'] . "' and language_id = '" . (int)1 . "'"); $product = tep_db_fetch_array($product_query); $new_products['products_description'] = $product['products_description']; echo ' <td width=255 valign=top align=center> <table cellspacing=0 cellpadding=0 align=center width=210 border=0> <tr><td colspan=2 height=6></td></tr> <tr><td valign=top align=center width=103><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, ' class=br') . '</a></td> <td valign=top height=97> <table cellspacing=0 cellpadding=0> <tr><td><span><a class=tx1 href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a></span><br><br class=px3></td></tr> <tr><td><img src=images/m42.gif width=103 height=1><br><br class=px3></td></tr> <tr><td class=tx> '.preg_replace('/\s\S*$/i', '', substr($new_products['products_description'], 0, 80)).' ... </td></tr> </table> </td></tr> <tr><td colspan=2 height=6></td></tr> <tr><td colspan=2><img src=images/m30.gif width=208 height=1></td></tr> <tr><td colspan=2 height=6></td></tr> <tr><td align=center width=103 class=tx2>'.$currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])).'</td><td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image_button('small_view.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ?<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_BUY_NOW) . '</a></td></tr> <tr><td colspan=2 height=10></td></tr> </table> </td> '; $col ++; if ($col > 1) { $col = 0; $row ++; echo ' </tr> </table> <table cellspacing=0 cellpadding=0> <tr><td><img src=images/m41.gif width=503 height=1></td></tr> </table> <table cellspacing=0 cellpadding=0 align=center width=500> <tr><td height=10 colspan=2></td></tr> <tr> '; } else echo '<td width=0></td>'; } echo ' </tr> </table> </td></tr> <tr><td><img src=images/m31.gif width=503 height=6></td></tr> <tr><td height=3></td></tr> </table> '; ?> <!-- new_products_eof //--> so I skipped it and tried to run it anyway (not expecting it to work, but to get an idea how to fix it) everything works fine , until I get this error when I click to email the price: Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/handltac/public_html/osc/includes/header.php:177) in /home/handltac/public_html/osc/includes/boxes/categories.php on line 13 can someone help me out with this one.....??? Thanks for your help and patience in advance. Quote
Guest Posted February 15, 2006 Posted February 15, 2006 It is the click for price contribution that I am trying to install. thanks Quote
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.
Note: Your post will require moderator approval before it will be visible.