OpenCart: How to make a global variable?-Collection of common programming errors

you can use $GLOBALS super global array

for example declare it first in controller/common/header.php

$GLOBALS["1"] = "test";

then use it in any tpl file like


regarding that header thing, that header and five other files are actually declared in every controller file (corresponding to every tpl file ) like this

$this->children = array(
            'common/column_left',
            'common/column_right',
            'common/content_top',
            'common/content_bottom',
            'common/footer',
            'common/header'     
        );

Answer to updated question

/catalog/controller/common/header.php