Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to only display the Currencies Drop Down Box in the header?


alex298

Recommended Posts

Posted

Hello,

 

The whole Currencies Box with header and box border will be shown when I copy the following curencies code to the header of osCommerce website:

 

include(DIR_WS_BOXES . 'currencies.php');

 

Actually I only want to display the Currencies Drop Down Box to the header. Could some experts here advise how to do that? I tried to edit the currencies.php, but no luck.

 

Thanks.

 

Alex

Alex

Posted
Actually I only want to display the Currencies Drop Down Box to the header. Could some experts here advise how to do that? I tried to edit the currencies.php, but no luck.

 

Thanks.

 

Alex

 

 

Paste this in your header.php (you might have to create its own cell, but it works !

 

<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>

 

tested an approved :-)

Posted

Dear pixclinic,

 

Thanks for your kind assistance! It works perfectly! You are really an expert.

Alex

Posted
Dear pixclinic,

 

Thanks for your kind assistance! It works perfectly! You are really an expert.

 

 

you are welcome

 

I just noticed that the real infobox has a feature that hides the menu when we are on the checkouts page, preventing people to change currencies during checkout shipping, payment and confirmation.

This is not implemented in what I posted. Let me know if that bothers you, I can make the addition.

  • 7 months later...
Posted
you are welcome

 

I just noticed that the real infobox has a feature that hides the menu when we are on the checkouts page, preventing people to change currencies during checkout shipping, payment and confirmation.

This is not implemented in what I posted. Let me know if that bothers you, I can make the addition.

 

Thanks! You solved my problem too. Much appreciated, i've been looking fr this for ages.

Archived

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

×
×
  • Create New...