kirubanidhi
kirubanidhi

Reputation: 77

Undefined variable and trying to get propery of non-object error prestashop

Notice: Trying to get property of non-object in /var/www/html/cy_prestashop/modules/taxcloud/taxcloud.php on line 699

Notice: Undefined variable: smarty in /var/www/html/cy_prestashop/modules/taxcloud/taxcloud.php on line 699

Im using prestashop version 1.5.6.2 . How to resolve above this error.

This is my code error occured page,

Taxcloud/taxcloud.php: line no 699,

$page_name = $psv >= 1.4 && Configuration::get('PS_FORCE_SMARTY_2') == 0 ?
    $smarty->tpl_vars['page_name']->value : 
    $smarty->get_template_vars('page_name');

Upvotes: 0

Views: 1545

Answers (1)

marsaldev
marsaldev

Reputation: 3349

In PrestaShop 1.5.x the global $smarty var is deprecated. You have to use:
$this->context->smarty

If also that snippet give you problem use this:
Context::getContext()->smarty

Upvotes: 5

Related Questions