additional
Home > Forum > Joomla components > Comparison Chart > Chart items not showing - internal servererror 500
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Chart items not showing - internal servererror 500

Chart items not showing - internal servererror 500 3 years 1 month ago #25291

Hi,

I just bought and installed Comparison Chart. Everything seems to work fine until I tried to create a menu item that shows Chart Items.
When I try to click the menu I get a blank page. The console log show an internal error 500.
When I check the error logs it gives me the following error:

PHP Parse error: syntax error, unexpected 'else' (T_ELSE) in D:\\uniserver_v1103\\UniServerZ\\www\\jlBelagroup\\components\\com_comparisonchart\\views\\items\\tmpl\\default.php on line 111

I have created two items and put them in the same category.
Also when I create a menu to show category, it works fine but when I click the category with the items in it, no items are showing either.

Please advice.

Thanks in advance!
The administrator has disabled public write access.

Chart items not showing - internal servererror 500 3 years 1 month ago #25292

Alright, I found the problem. There is a bug in the code. (small typo error)

I found the following code in the default.php file:
<div class="compare-block"  id="chart-notice">
    <?php
 
    // $count_compare=count($app->getUserState('com_comparisonchart.chart'.intval($this->chart->id)));
    if(!count($this->compare)){
        $session =JFactory::getSession();
        $this->compare=$session->get('com_comparisonchart.chart'.$this->chart->id);
    }
    $count_compare = count($this->compare);
    if ($count_compare > 0) {
        echo $count_compare . ' item(-s) <a href="#" onclick="jQuery(\'#charts-form\').submit();">added to compare.</a>';
        $ids = array();
        $ids = array_keys($this->compare);?>
        <script type="text/javascript">
            jQuery(document).ready(function () {
                <?php    for($i=0; $i<count($ids); $i++){
                        ?>
 
 
                jQuery('#item<?php echo $ids[$i];?>').prop('checked', true);
                jQuery("label[for='item<?php echo $ids[$i];?>']").addClass('c_on');
 
                <?
                    }?>
            });
        </script>
    <?php
    } else {
        echo 'No items selected.';
    }?>
 
</div>

Just above where "</script"> ends, you see:
<?
}?>

I changed it to:
<?php
}?>

Now it works.
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 0.155 seconds

We do our best to secure your data and to be
GDPR compliant.
However, we are not fully there yet.

With that said we'd like you to know that we use cookies.
We store user session cookie only to enable both registered and guest users to use the shopping cart.
Please note that 3rd party cookies may still be encountered on the pages with social media "share" and "like" buttons.

To ensure your privacy we have currently stopped using any analytics tools like Google Analytics.

We anonymize your IP address on the server side so your IP is not tracked by any means.

We DO NOT pass ANY of your data to 3rd parties.
We will do our best to provide maximum transparency in future if anything will change.

Also, we will store cookies to determine if you saw this message.