Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

manufactures redirects to search!?


ncoded

Recommended Posts

hi, we have a site here,

 

www.homestansted.co.uk

 

- however when you click a manufacturer from the dropdown (bottom left) it actuallyt takes you to /search/ (eg advanced_search.php).

 

so, i extracted the code that for the drop down, and all looks fine, see here:

 

www.homestansted.co.uk/man.php

 

as you can see, outside the site, it all works fine.

 

have taking a look at the code for /boxes/manufactures.php - and it all looks fine (compared to other site which has not been changed). (SEE BELOW).

 

Thanks for any help,

 

crz

 

--------------------------------------------------------- C O D E -------------------------------------------- MANUFACTURERS.PHP -----------------------

 

<?php

/*

$Id: manufacturers.php,v 1.19 2003/06/09 22:17:13 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

$manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");

if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {

?>

<tr><td>

<!-- manufacturers //-->

<?php

$info_box_contents = array();

$info_box_contents[] = array('text' => BOX_HEADING_MANUFACTURERS);

 

new infoBoxHeading($info_box_contents, false, false);

 

if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {

// Display a list

$manufacturers_list = '';

while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {

$manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);

if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<b>' . $manufacturers_name .'</b>';

 

//i have changed FILENAME_DEFAULT to index.php below, to try to get the manuf working

$manufacturers_list .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a><br>';

}

 

$manufacturers_list = substr($manufacturers_list, 0, -4);

 

$info_box_contents = array();

$info_box_contents[] = array('text' => $manufacturers_list);

} else {

// Display a drop-down

$manufacturers_array = array();

if (MAX_MANUFACTURERS_LIST < 2) {

$manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);

}

 

while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {

$manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);

$manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],

'text' => $manufacturers_name);

}

 

$info_box_contents = array();

$info_box_contents[] = array('form' => tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'),

'text' =>'

<br style="line-height:2px">'.tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style=" width:100%;"') . tep_hide_session_id().

'

 

');

}

 

new infoBox($info_box_contents);

?>

<!-- manufacturers_eof //-->

<?php

}

?>

</td></tr>

Link to comment
Share on other sites

You're missing a </form> tag.

 

Looking at the HTML source it goes:

 

<form name="currencies" action="http://www.homestansted.co.uk/index.php" method="get"><select name="currency" onChange="this.form.submit();" style="width:105px"><option value="GBP" SELECTED>Pounds</option></select></form>


(HTML CODE HERE)

<form name="advanced_search" action="http://www.homestansted.co.uk/search/results.html" method="get" onSubmit="return check_form(this);">

(HTML CODE HERE)

<form name="manufacturers" action="http://www.homestansted.co.uk/index.php" method="get">
<br style="line-height:2px"><select name="manufacturers_id" onChange="this.form.submit();" size="0"  style=" width:100%;"><option value="" SELECTED>Please Select</option><option value="13">Early Doors Ltd</option><option value="14">Louise</option></select>
</form></td>

The </form> after the advanced search is missing.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

sorry germ, can you explain?

 

i understand that a </form> is missing from the advanced_search bit.

 

however, where (what page) did you view the html from? index.php??

 

it seems to consist of currency/advanced search (header), and manufactuerers.

 

thanks again.

Link to comment
Share on other sites

ok did a quick check in header.php and found that code reposible for <form>, or in this case, advanced_search form.

 

<?php echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get', 'onSubmit="return check_form(this);"') . tep_hide_session_id(); ?>

 

i def havent changed anything in tep_draw_form() so im abit unsure about this one.

 

advanced_search works ok, it just manufactures.php that does not, or rather the M box redirect to the correct page.

 

ck

Link to comment
Share on other sites

I'd try changing this code:

 

<?php echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get', 'onSubmit="return check_form(this);"') . tep_hide_session_id(); ?>

to

 

<?php echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get', 'onSubmit="return check_form(this);"') . tep_hide_session_id(); ?>
</form>

BACKUP THE FILE BEFORE MAKING ANY EDITS

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

thank you jim, that worked at treat.

 

i just assumed that a function called tep_draw_form() would also close the <form> tag.

 

SOLVED. IF YOU HAVE THIS PROBLEM, CHECK THAT THE </FORM> IS BEING CLOSD, AS ABOVE.

Link to comment
Share on other sites

ok perhaps that was a bit premature,..

 

just done a check and with the closing <form> tag now my top search input does not work.

 

so i seem to have a choice, either the manufactures work, or the top search.

 

so far, i have choosen the search field.

 

obv some how the two are related, which seems abit odd.

 

any idea?

 

ck

Link to comment
Share on other sites

Your <form> tags are screwed up.

 

Fix them and it should work.

 

This brings us to another set of realities:

 

1. You have a purchased template.

 

2. It seems to have serious code flaws.

 

Which brings us to:

 

3. Seek support from the template provider if you are having problems.

 

I'm really not trying to be a jerk about this, but the simple truth of the matter is that is is an osCommerce support forum not a "support template provider X" forum.

 

If template providers were forced to support their work they might start doing a better job at coding in the first place.

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

hey Jim, harsh but true I guess.

 

so you know, im comming from a c++/php background.

 

your right the template was from tmonst**, and i would def agree that they have messed with some of the functions/code.

 

what i will have to do is install a new version of osc, then go through some of the major files and function, tep_form() for instance - and try and work backwards to what i have now.

 

personally i think the real issue is the non-seperate between template and code, which means you have to mess around with functions to get your template to work.

 

but hey, its good enough for the momment, and we all (i guess) look foward to OSC Version 3 (sooner rather than later, due to Magento).

 

anyway, thanks for all your help jim.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...