missenyaface
missenyaface

Reputation: 23

Undefined Variable Line 91 Open cart

When I view my Open Cart theme on a mobile screen size I get the following error:

Notice: Undefined variable: text_toplinks in /home/content/76/11344876/html/shop/catalog/view/theme/cs-onestar/template/common/header.tpl on line 91

when I go into the file I see the following on line 91:

<span><?php echo $text_toplinks; ?></span>

screenshot

I'm not sure how to get the $text_toplink to say "Menu" or simple "Top Menu".

I'm new to the whole PHP and Open Cart stuff I'm used to CSS and HTML and have extensive knowledge on both but this is really mind boggling me because I can't seem to find an answer. 

Upvotes: 2

Views: 264

Answers (2)

Arian Faurtosh
Arian Faurtosh

Reputation: 18511

This is what I would do. It will check to see if the variable is set, before printing it out, which will prevent you from getting that notice. https://www.php.net/isset

<span><?php
    if(isset($text_toplinks)){
        echo $text_toplinks;
    }
?></span>

Upvotes: 1

Suman Bogati
Suman Bogati

Reputation: 6349

It means there is no value coming inside your php variable $text_toplinks; and its not defined anywhere during the execute of your code.

If you'll provide more code(from where the $text_toplinks; is expected to coming) then there would be easy to find out the problem.

Upvotes: 0

Related Questions