T
T
Temur Begiev2015-03-30 13:51:03
opencart
Temur Begiev, 2015-03-30 13:51:03

How to get the name of an OpenCart template?

I want to make a dynamic url for css in OpenCart.
Example:
Instead

<link href="catalog/view/theme/default/stylesheet/stylesheet.css" rel="stylesheet">

This is
<link href="catalog/view/theme/<?php echo $templateurl; ?>/stylesheet/stylesheet.css" rel="stylesheet">

And so that the name of the template is built in by itself.
Please advise how this can be implemented.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Evgrafovich, 2015-03-30
@temurbegiev

Where exactly do you need it and why?
In the general case, in the corresponding controller, you need to insert the code somewhere before

$this->data['templateurl'] = $this->config->get('config_template');

then $templateurl can be used in the form that this controller generates. For a header, for example, you edit the controller controller/common/header.php and get a variable in the form common/header.tpl

S
Shamil, 2015-03-30
@jawakharlal

catalog/view/*/default/stylesheet/
at least I've seen it done in vqmod files

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question