Jump to content

500 error while opening categories


Recommended Posts

Hello, when i open any categories page i get 500 error , after that i turned of Developer mode.

error text :

 

 Parse error: syntax error, unexpected '$category' (T_VARIABLE), expecting function (T_FUNCTION) or const (T_CONST) in /home/panizir/public_html/override/controllers/front/listing/Category Controller.php on line 26 prestashop

-----------------------------------------------------------------------------------------------

and Controller.php file :

<?php
class CategoryController extends CategoryControllerCore
{
    /*
    * module: stoverride
    * date: 2020-05-02 00:24:46
    * version: 1.0.0
    */
    protected function doProductSearch($template, $params = array(), $locale = null)
    {
        if ($this->ajax) {
            ob_end_clean();
            header('Content-Type: application/json');
            $variables = $this->getAjaxProductSearchVariables();
            if(!Configuration::get('STSN_REMOVE_PRODUCTS_VARIABLE'))
                unset($variables['products']);
            $this->ajaxDie(json_encode($variables));
        } else {
            $variables = $this->getProductSearchVariables();
            $this->context->smarty->assign(array(
                'listing' => $variables,
            ));
            $this->setTemplate($template, $params, $locale);
        }
    }
        $category = parent::getTemplateVarCategory();
        
        if (Module::isInstalled('jscomposer') && (bool) Module::isEnabled('jscomposer')) {
            $description = $category['description'];
            $instance = Module::getInstanceByName('jscomposer');
            $instance->init();
            $category['description'] = $instance->do_shortcode($description);
        }
        
        return $category;
    }
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...