How to get the store name when in the Document class. This is what I am trying to do:
public function setTitle($title) {
// Append store name if small title
if(strlen($title) < 30){
$this->title = $title . ' - ' . $this->config->get("store_name");
} else {
$this->title = $title;
}
}
Although the $this
is referring to the document class. How to I get the config?
Using the latest version of opencart 1.5.2.1
When you check the index.php
file to see how config is loaded
// Registry
$registry = new Registry();
// Loader
$loader = new Loader($registry);
$registry->set('load', $loader);
// Config
$config = new Config();
$registry->set('config', $config);