Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

$languagebox drop-down menu


tementa

Recommended Posts

Hi,

 

How I can to display $languagebox in a drop-down menu?

 

The file that makes the $languagebox display is includes/boxes/languages.php

 

I tried this but I get no the right result

 

<!-- languages //-->
	  <tr>
		<td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_LANGUAGES);

 new infoBoxHeading($info_box_contents, false, false);

 if (!isset($lng) || (isset($lng) && !is_object($lng))) {
include(DIR_WS_CLASSES . 'language.php');
$lng = new language;
 }

 $languages_string = '';
 reset($lng->catalog_languages);

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

 }


 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'center',
						   'text' => $languages_string);

 new infoBox($info_box_contents);
?>

		</td>
	  </tr>
<!-- languages_eof //-->

 

Please help

 

Thanks in advance

Link to comment
Share on other sites

I get this now

 

<!-- languages //-->
	  <tr>
		<td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_LANGUAGES);

 new infoBoxHeading($info_box_contents, false, false);

 if (!isset($lng) || (isset($lng) && !is_object($lng))) {
include(DIR_WS_CLASSES . 'language.php');
$lng = new language;
 }

 $languages_string = '';
 reset($lng->catalog_languages);

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

 }


 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'center',
						   'text' => tep_draw_pull_down_menu('languages', $languages_string) . $hidden_get_variables . tep_hide_session_id());


 new infoBox($info_box_contents);
?>

		</td>
	  </tr>
<!-- languages_eof //-->

 

 

An the error that displays is this:

 

Fatal error: Cannot use string offset as an array in C:\wamp\www\tienda\includes\functions\html_output.php on line 306
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...