Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

no adding products to shopping cart since header.php change


tati

Recommended Posts

I recently put in a big chunk of my advanced search into my header.php as i permanently need it there. since then i can't add pruoducts to the shopping cart but get the product_info.php instead.

 

if i comment out the search stuff on top, it works fine again.

 

any clues as to what this might be related? something with sessions? (i don't know very much about sessions but if you say it's to do with this i'll get into it)

 

thanks for any help!!

Link to comment
Share on other sites

Post the search code that you added to your header file.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

sorry for delay (below the code of my header file).

 

i found that it is actually only some products you can't add to the shopping cart!?! some you can't add with the buy now butten but with only form the product info page! and most products you can add directly with the buy now butten.

 

i'm starting to doubt that it has something to do with the search ...

 

URL to test www.smartstart-toys.com/index.php

 

my header.php:

 

<?php

/*

 $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $



 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Copyright (c) 2003 osCommerce



 Released under the GNU General Public License

*/



// check if the 'install' directory exists, and warn of its existence

 if (WARN_INSTALL_EXISTENCE == 'true') {

   if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {

     $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');

   }

 }



// check if the configure.php file is writeable

 if (WARN_CONFIG_WRITEABLE == 'true') {

   if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) {

     $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning');

   }

 }



// check if the session folder is writeable

 if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {

   if (STORE_SESSIONS == '') {

     if (!is_dir(tep_session_save_path())) {

       $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning');

     } elseif (!is_writeable(tep_session_save_path())) {

       $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning');

     }

   }

 }



// check session.auto_start is disabled

 if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {

   if (ini_get('session.auto_start') == '1') {

     $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');

   }

 }



 if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {

   if (!is_dir(DIR_FS_DOWNLOAD)) {

     $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');

   }

 }



 if ($messageStack->size('header') > 0) {

   echo $messageStack->output('header');

 }

?>

<table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/header_bg.gif">

 <tr class="header"> 

   <td height="91" colspan="3"><img src="../images/spacer.gif" width="1" height="91"></td>

   <td width="146" rowspan="3" align="right" valign="bottom"><a href="<?php /* HOME LINK */ echo tep_href_link(FILENAME_DEFAULT); ?>"><img src="images/logo.gif" alt="SmartStart-Toys.com" width="145" height="150" border="0"></a></td>

 </tr>

 <tr class="header"> 

   <td width="150" height="32" valign="middle"><img src="../images/spacer.gif" width="1" height="32"></td>

   <td valign="middle" class="header"><?php // achtung form umbennnen

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(); 

echo "".tep_draw_input_field('keywords', '', 'style="width: 17%"');

// no cat's required in search?

//echo " ".tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES))));

echo " ".tep_draw_pull_down_menu('learningvalues_id', tep_get_learningvalues(array(array('id' => '', 'text' => TEXT_ALL_LEARNINGVALUES))));

echo " ".tep_draw_pull_down_menu('agegroup_id', tep_get_agegroup(array(array('id' => '', 'text' => TEXT_ALL_AGEGROUPS))));





// if susanna wants an image as submit button 

// echo tep_image_submit('button_search.gif', IMAGE_BUTTON_SEARCH);

?>

<input type="submit" value="Go" style="width:7%" ><input name="search_in_description" type="hidden" id="search_in_description" value="1"></form></td>





<td align="right" valign="middle"><font color="#FFFFFF" size="1" face="Arial, Helvetica, sans-serif"><strong>Currency</strong></font> 

     <?php if (isset($currencies) && is_object($currencies)) {

// general currency stuff and checks i guess

reset($currencies->currencies);

   $currencies_array = array();

   while (list($key, $value) = each($currencies->currencies)) {

     $currencies_array[] = array('id' => $key, 'text' => $value['title']);

   }



   $hidden_get_variables = '';

   reset($HTTP_GET_VARS);

   while (list($key, $value) = each($HTTP_GET_VARS)) {

     if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {

       $hidden_get_variables .= tep_draw_hidden_field($key, $value);

     }

   }

// form

echo tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get');

// pulldown

echo '<span title="Select your Currency here!">';

echo (tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();"') . $hidden_get_variables . tep_hide_session_id());

echo '</span>';

?>

     <?php

 }

?>

   </td>

 </tr>

 <tr class="header"> 

   <td colspan="3" valign="middle"><img src="../images/spacer.gif" width="1" height="27"></td>

 </tr>

</table>





<table border="0" width="100%" cellspacing="0" cellpadding="1">

 <tr class="headerNavigation">

   <td class="headerNavigation">  </td>

   <td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>   </td>

 </tr>

</table>





<?php // table only appears when error

 if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

 <tr class="headerError">

   <td class="headerError"><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></td>

 </tr>

</table>

<?php

 }

// INFO Message ??

 if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

 <tr class="headerInfo">

   <td class="headerInfo"><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></td>

 </tr>

</table>

<?php

 }

?>

Link to comment
Share on other sites

will do a fresh install of the shop and do it all from scratch.... :-(

so thw above link won't be relevant anymore - sorry.

 

but if somebody has a clue as to why this happened and wants to look at the header file i'd still be more than pleased!!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...