Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem Currencies in Box.


KLAYMAN

Recommended Posts

Hello, before nothing thanks for help me.

 

I have a problem whith Currencies in the Header.

 

Apparently it works well always, but the first time that loads the Web and that changes directly of coin does not evidence produces and matches to a page that says that "there are no products in this category".

Does somebody know that fail?.

 

In Header fail, but not in column_right.

 

The code I have copied it of this same Forum, but it fails the first time when load the Web and change coin:

 

<table width="200" cellpadding="3">
<?php
if (isset($currencies) && is_object($currencies)) {
?>
<tr>
<td>
<?php
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);
  }
}

echo  tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get');
echo  tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id();
?>


		</td>
	  </tr>
<?php
 }
?>
</table>

 

To try it here:

OScommerce Shop

 

Pardon for my English.

Link to comment
Share on other sites

Solved:

 

<?php
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);
}
}
echo tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get');
echo tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables 

. tep_hide_session_id();
echo '</form>';
?>
<!-- currencies_eof //-->

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...