archaeology101 Posted October 6, 2009 Posted October 6, 2009 Hello, I just started working on OSCommerce yesterday. Have been running an online shop for an employer since 2003 (MIVA Merchant) with basic html/PHP front end. What can I say...I'm seriously impressed with OSCom...wish I would've implemented it years ago. Anyway...I'm stuck on probs configuring the column_left.php and whats_new.php. Apologies if there is a topic dedicated to this couldn't find it. I'm trying to limit the "What's New" box to 1(one) product or remove it altogether. When removing it completely using: //require(DIR_WS_BOXES . 'whats_new.php'); I end up with three times the Categories box. Here's a sample page of the problem with What's New removed: http://archaeology101.me/store/catalog/product_info.php?products_id=28 Excuse the mess on the site...we just started customizing the GUI yesterday. thanks!
FIMBLE Posted October 6, 2009 Posted October 6, 2009 can you list the file here, for us to look at? Nic Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
archaeology101 Posted October 6, 2009 Author Posted October 6, 2009 can you list the file here, for us to look at? Nic Yeah sure...the basic whats_new.php that was installed with OS Commerce. I just commented out the manufacturer box and added // to block out the what's new box (but will use this after figuring out how to modify whats_new.php to list one product only. 1st php file: column_left.php <?php /* $Id: column_left.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_categories_box(); } else { include(DIR_WS_BOXES . 'categories.php'); } /*if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_manufacturers_box(); } else { include(DIR_WS_BOXES . 'manufacturers.php'); }*/ //require(DIR_WS_BOXES . 'whats_new.php'); require(DIR_WS_BOXES . 'search.php'); require(DIR_WS_BOXES . 'information.php'); ?> 2nd php file: whats_new.php <?php /* $Id: whats_new.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) { ?> <!-- whats_new //--> <tr> <td> <?php $random_product['products_name'] = tep_get_products_name($random_product['products_id']); $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']); $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_WHATS_NEW); new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW)); if (tep_not_null($random_product['specials_new_products_price'])) { $whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br>'; $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>'; } else { $whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])); } $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br> <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br>' . $whats_new_price); new infoBox($info_box_contents); ?> </td> </tr> <!-- whats_new_eof //--> <?php } ?>
FIMBLE Posted October 6, 2009 Posted October 6, 2009 use this instead, it also removes the whats new box <?php /* $Id: column_left.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_categories_box(); } else { include(DIR_WS_BOXES . 'categories.php'); } /*if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_manufacturers_box(); } else { include(DIR_WS_BOXES . 'manufacturers.php'); } require(DIR_WS_BOXES . 'whats_new.php'); */ require(DIR_WS_BOXES . 'search.php'); require(DIR_WS_BOXES . 'information.php'); ?> Nic Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
archaeology101 Posted October 6, 2009 Author Posted October 6, 2009 Tried that earlier and tried again. Same problem. Lists data for the catalog three times as if there were three boxes. See here: http://archaeology101.me/store/catalog/product_info.php?products_id=28&language=en
FIMBLE Posted October 6, 2009 Posted October 6, 2009 Which other files have been altered? This should not happen with such an simple edit Nic Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
archaeology101 Posted October 6, 2009 Author Posted October 6, 2009 Which other files have been altered? This should not happen with such an simple edit Nic I see. these files were edited with saved changes: index.php (just removed welcome and icons - I now restored to original) header.php (changed colors, removed icons, switched logos, centered page and changed width) footer.php (changed colors) english/index.php (removed default text about how to edit the store) column_left.php various boxes to edit colors only any of these gonna be the one? thanks!
archaeology101 Posted October 6, 2009 Author Posted October 6, 2009 I did narrow it down to search.php which is invoking two listings of categories in addition to the search function. Just want the search box function. Here's the code I was using...is there something I messed up here: PHP: search.php <?php /* $Id: search.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ ?> <!-- search //--> <tr> <td> <?php new infoBoxHeading($info_box_contents, false, false); $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'), 'align' => 'middle', 'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_image_submit('button_go.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>'); new infoBox($info_box_contents); ?> </td> </tr> <!-- search_eof //-->
archaeology101 Posted October 6, 2009 Author Posted October 6, 2009 I fixed it with the below default code (except button_go.gif which I added). Now I remember...I was trying to make this into a one line search to put in the navigation bar at the top of the page. Any idea how to reduce this code into just one line with search text box (populated with SEARCH) and the search button (originally button_quickfind.gif...changed to button_go.gif here). thanks! <?php /* $Id: search.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ ?> <!-- search //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_SEARCH); new infoBoxHeading($info_box_contents, false, false); $info_box_contents = array(); $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'), 'align' => 'center', 'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_image_submit('button_go.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>'); new infoBox($info_box_contents); ?> </td> </tr> <!-- search_eof //-->
♥ecartz Posted October 7, 2009 Posted October 7, 2009 echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: 95px"') . ' ' . tep_hide_session_id() . tep_image_submit('button_go.gif', BOX_HEADING_SEARCH) . '</form>'; or something like that. You may need to change the 95 for your store. BOX_WIDTH - 30 is not really meaningful for the header. The ' ' should have a in it. Always back up before making changes.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.