Hello,

When going through testing, during checkout, I received the following error which showed up in place of the language flag at the top of the page:

Warning: Variable passed to each() is not an array or object in C:\wamp\www\zc137\includes\modules\sideboxes\ZC03C00179\languages_az01.php on line 34

This was during the checkout_shipping (Step 1 of 3) phase.

Version: Zen-Cart 1.3.7
Purchased Template: http://www.algozone.com/shop/zencart...179-p-588.html


It is running locally, so I don't have a url or ftp server for you to access it.

I pulled up the file and looked at line 34 which is:

while (list($key, $value) = each($lng->catalog_languages)) {

Below is the entire file sited in the error statement above.

Any help in how to fix this issue would be appreciated.

Thanks,
Bob


<?php
/*
$Id: languages_az01.php,v 1.0 2004/09/09 hpdl Exp $

For osCommerce, Open Source E-Commerce Solutions
Created by http://www.template-faq.com

Copyright (c) 2004 template-faq.com, Inc

*/

// test if box should display
$show_languages = false;

if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
$show_languages = true;
}

if ($show_languages == true) {
if (!isset($lng) || (isset($lng) && !is_object($lng))) {
$lng = new language;
}

reset($lng->catalog_languages);
$title = BOX_HEADING_LANGUAGES;
$left_corner = false;
$right_corner = false;
$right_arrow = false;
$title_link = false;
}

$content = '';
$languages_count = 0;
while (list($key, $value) = each($lng->catalog_languages)) {
$content .= '<a href="' . zen_href_link(basename($PHP_SELF), zen_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . zen_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name'], null, null, 'class="alignMiddle"') . '</a>&nbsp;';
$languages_count++;
}

if($languages_count > 0)
{

?>
<tr>
<td>
<!--// bof: <?php echo $box_id; ?> //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="infoBox<?php echo $column_location; ?>">
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="infoBoxContents<?php echo $column_location; ?>">
<tr><td><?php echo zen_draw_separator('pixel_trans.gif', '100%', '1'); ?></td></tr>
<tr>
<td class="boxText" id="<?php echo str_replace('_', '-', $box_id . '-content'); ?>"><?php echo $content; ?></td>
</tr>
<tr><td><?php echo zen_draw_separator('pixel_trans.gif', '100%', '1'); ?></td></tr>
</table>
</td>
</tr>
</table>
<!--// eof: <?php echo $box_id; ?> //-->
</td>
</tr>
<?php } ?>