Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

currency box content


awilson3rd

Recommended Posts

Posted

I would like to be able to add a html link just beneath the drop down box in the currency box to link to an external currency converter popup.

 

I just want the link to say 'currency convert'

 

the box code at the moment is as follows, can anyone tell me how to add the link (I dont know what the html will be yet)

 

Thanks in advance for any advise.

 

<?php

/*

$Id: currencies.php,v 1.16 2003/02/12 20:27:31 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

if (isset($currencies) && is_object($currencies)) {

?>

<!-- currencies //-->

<tr>

<td>

<?php

$info_box_contents = array();

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

 

new infoBoxHeading($info_box_contents, false, false);

 

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

}

}

 

$info_box_contents = array();

$info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),

'align' => 'center',

'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id());

 

new infoBox($info_box_contents);

?>

</td>

</tr>

<!-- currencies_eof //-->

<?php

}

?>

Posted
I would like to be able to add a html link just beneath the drop down box in the currency box to link to an external currency converter popup.

 

I just want the link to say 'currency convert'

 

the box code at the moment is as follows, can anyone tell me how to add the link (I dont know what the html will be yet)

 

Thanks in advance for any advise.

 

<?php

/*

  $Id: currencies.php,v 1.16 2003/02/12 20:27:31 hpdl Exp $

 

  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com

 

  Copyright ? 2003 osCommerce

 

  Released under the GNU General Public License

*/

 

  if (isset($currencies) && is_object($currencies)) {

?>

<!-- currencies //-->

          <tr>

            <td>

<?php

    $info_box_contents = array();

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

 

    new infoBoxHeading($info_box_contents, false, false);

 

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

      }

    }

 

    $info_box_contents = array();

    $info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),

                                'align' => 'center',

                                'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id());

 

    new infoBox($info_box_contents);

?>

            </td>

          </tr>

<!-- currencies_eof //-->

<?php

  }

?>

 

You can change

text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id());

to something like

text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id()) . '<br><br><a href="' . tep_href_link('your new file.htm') . '">' . 'Currency Converter' . '</a><br>';

 

If you need it multilanguage you will have to create a define for the 'Currency Converter' textual part.

 

HTH

Posted

Thanks for the reply.

 

I have changed the code and the page loaded with no errors but now I don't see any drop-down list or 'currency converter' link. All I see in the currencies box are the letters AA

 

Any ideas?

 

(code as it is now)

 

<?php

/*

$Id: currencies.php,v 1.16 2003/02/12 20:27:31 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

if (isset($currencies) && is_object($currencies)) {

?>

<!-- currencies //-->

<tr>

<td>

<?php

$info_box_contents = array();

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

 

new infoBoxHeading($info_box_contents, false, false);

 

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

}

}

 

$info_box_contents = array();

$info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),

'align' => 'center',

'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id()) . '<br><br><a href="' . tep_href_link('your new file.htm') . '">' . 'Currency Converter' . '</a><br>';

 

new infoBox($info_box_contents);

?>

</td>

</tr>

<!-- currencies_eof //-->

<?php

}

?>

Posted
Thanks for the reply.

 

I have changed the code and the page loaded with no errors but now I don't see any drop-down list or 'currency converter' link. All I see in the currencies box are the letters AA

 

Any ideas?

 

(code as it is now)

 

<?php

/*

  $Id: currencies.php,v 1.16 2003/02/12 20:27:31 hpdl Exp $

 

  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com

 

  Copyright ? 2003 osCommerce

 

  Released under the GNU General Public License

*/

 

  if (isset($currencies) && is_object($currencies)) {

?>

<!-- currencies //-->

          <tr>

            <td>

<?php

    $info_box_contents = array();

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

 

    new infoBoxHeading($info_box_contents, false, false);

 

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

      }

    }

 

    $info_box_contents = array();

    $info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),

                                'align' => 'center',

                                'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id()) . '<br><br><a href="' . tep_href_link('your new file.htm') . '">' . 'Currency Converter' . '</a><br>';

 

    new infoBox($info_box_contents);

?>

            </td>

          </tr>

<!-- currencies_eof //-->

<?php

  }

?>

 

I think so yes. I see I copied the last part after the closing ')'.

It should be like this:

'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id() . '<br><br><a href="' . tep_href_link('your new file.htm') . '">' . 'Currency Converter' . '</a><br>');

Posted
I think so yes. I see I copied the last part after the closing ')'.

It should be like this:

'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id() . '<br><br><a href="' . tep_href_link('your new file.htm') . '">' . 'Currency Converter' . '</a><br>');

 

 

That worked! Thanks very much for your help

 

Andrew

Posted
That worked! Thanks very much for your help

 

Andrew

 

 

The code worked but whenI added an external html link it didnt.

 

For example if I add http://www.xe.com/ucc/ it tries to load that page within my own website, http://www.mysite.com/catalog/http://www.xe.com/ucc/

 

My knowledge of php and html is limited and I don't know how to get around this.

 

Thanks

 

Andrew

Posted
The code worked but whenI added an external html link it didnt.

 

For example if I add http://www.xe.com/ucc/ it tries to load that page within my own website, http://www.mysite.com/catalog/http://www.xe.com/ucc/

 

My knowledge of php and html is limited and I don't know how to get around this.

 

Thanks

 

Andrew

 

 

Sorted it, thanks for your help.

 

Removed the tep_href_link and just added a href="http://www.xe.com/ucc/">Currency Converter</a>

 

Thanks

 

Andrew

Posted
The code worked but whenI added an external html link it didnt.

 

For example if I add http://www.xe.com/ucc/ it tries to load that page within my own website, http://www.mysite.com/catalog/http://www.xe.com/ucc/

 

My knowledge of php and html is limited and I don't know how to get around this.

 

Thanks

 

Andrew

 

I had to take a look in tep_href_link and if I see correct it always adds the path to the catalog directory while looking for the called file there. So it's not really suitable for this kind of external links I guess and it's better to make it a normal HTML call (you don't session id's anyway in this external page). I'll add a "TARGET=_blank" tag so it will open in a new window.

 

'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id() . '<br><br><a href="http://www.xe.com/ucc/" TARGET=_blank>Currency Converter</a><br>');

 

I hope I didn't miss anything in this.

Archived

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

×
×
  • Create New...