Opencart: Static directory path in $this->load->view in opencart2.2

Created on 16 Mar 2016  路  3Comments  路  Source: opencart/opencart

Whenever a new theme folder created with custom modules,opencart2.2 is not changing the path for loading .tpl file.
for example,I made a theme folder named 'newtheme' with custom module module/custommodule.tpl.

return $this->load->view('module/custommodule', $data);

when above line executes it is trying to load file 'upload/catalog/view/theme/default/template/module/custommodule.tpl' instead of 'upload/catalog/view/theme/newtheme/template/module/custommodule.tpl'.

All 3 comments

Regarding this, my old themes (<2.2.0.0) try to load
$this->load->view($this->config->get('config_template') . '/template/payment/webpay_plus.tpl', $data)
resulting in:
catalog/view/theme/default/template//template/payment/webpay_plus.tpl error
So I change it to:
$this->load->view('payment/webpay_plus.tpl', $data);
And now works ok, but after see your issue here I notice that the correct line must be:
$this->load->view($this->config->get('config_template') . 'payment/webpay_plus.tpl', $data);
Try that.
BTW where can I find a complete list of changes in 2.2.0.0 (technical overview, not the change log with just a line of info)

Thanks. I solved it.
and solution is
return $this->load->view('module/custommodule', $data);
there is no need to write .tpl as opencart modified the format.
you can find the detailed changes from here http://sv2109.com/en/article/changes-opencart-22200a1

i'm confused, the solution is the same as your initial code, what do you change then?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PrivateAlpha picture PrivateAlpha  路  3Comments

danceleisure picture danceleisure  路  3Comments

nasserman picture nasserman  路  5Comments

evgenekorolev picture evgenekorolev  路  3Comments

auwalismail picture auwalismail  路  5Comments