Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Currecy-Change & hyperlink


maetzie

Recommended Posts

Hi,

 

I have a simle question, but I can't solve it. Is it possible to change the currency by clicking an image-button. I've tried to change the currencies.php-box like the languages-box and eliminate the languages box, because I don't need it.

 

I have to insert two image-buttons with flags into the header. If you push a flag the currency will be changed. :D But my php-knowlege isn't so good...bad bad !!!

 

Please help...

 

Greetz Matze

 

________

testshop >>

Link to comment
Share on other sites

Like this:

 

  <td><?php 
 if (!is_object($lng)) { 
   include(DIR_WS_CLASSES . 'language.php'); 
   $lng = new language; 
 } 

 if (getenv('HTTPS') == 'on') $connection = 'SSL'; 
 else $connection = 'NONSSL'; 

 $languages_string = ''; 
 reset($lng->catalog_languages); 
 while (list($key, $value) = each($lng->catalog_languages)) { 
   $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $connection) . '">' . tep_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> '; 
 } 

echo $languages_string; 
?></td>

 

 

 

B) Matti

Link to comment
Share on other sites

Hi Matti,

 

nearly...that was my first idea too...but i have the problem, that my shop has only one language but two currencies. You can look to the testshop. There are the two buttons with the flags in the header.

 

Your thought is good :rolleyes: , but to get two icons I have to copy my own language and rename it to have an multilanguage shop. ...And this is a big roundabout way :( .

 

Isn't it possible to speak to a variable directly ???

Like p.e.:

<?php echo '<a href="' . tep_href_link($currency=EUR) . '">' . tep_image(DIR_WS_IMAGES . 'infobox/headertop_euro.gif', 'Currency: EURO') . '</a>'; ?>

 

Thanks for replies...it's very important.

 

Greetz Matze

Link to comment
Share on other sites

@Matti

 

Hi,

 

thanks for your reply. I had this idea too. But this will be a problem. I have only one language in my shop but two currencies to handle. You can watch my testshop here. So the problem isn't a dynamic solution, I need only a static one. The two buttons in the header should include an hyperlink like (I don't know the right variables... :( ):

 

<?php echo '<a href="' . tep_href_link(?currency=EUR) . '">' . tep_image(DIR_WS_IMAGES . 'infobox/headertop_euro.gif', 'W?hrung: EURO') . '</a>'; ?>

 

Isn't it possible to talk to directly the variable currency without the language variable. Just like the DropDownMenue in the Currencies-Box.

 

Thanks for your ideas :)

 

Maetzie

Link to comment
Share on other sites

When I try to go to your site, I'm currently getting

Warning: main(includes/languages/.php) [function.main]: failed to create stream: No such file or directory in /www/htdocs/v082189/shop/includes/application_top.php on line 292

 

Fatal error: main() [function.main]: Failed opening required 'includes/languages/.php' (include_path='.:..') in /www/htdocs/v082189/shop/includes/application_top.php on line 292

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...