Post by xseon » Thu Jun 14, 2018 9:50 pm

I'd like to propose an effective way to allow store owners set what template file to be associated with each layout. You can see it better in the attached picture but in brief:
  • In the Layout edit form should be added a new column with Upload, Download and Restore buttons for mainaining template files.
  • Uploaded files with the same name as the default name may rename the existing default file so that to be possible to restore it later if necessary.
  • Users will see the file name that is being currently used right before the buttons and will have the ability to change the file. Editing it would be available in Theme Editor section.
Then we need all controller files that output data in the catalog (clients area) to add the file name as a variable and include it in the output statement. For exapmle, for products it is:

Code: Select all

$this->response->setOutput($this->load->view('product/product', $data));
It may become like this:

Code: Select all

$this->response->setOutput($this->load->view('product/'.$filename, $data));
I think this would be a much appreciated improvement. And it seems to me it can be done easily. I hope I'm not missing something. Have a look and let me know how you think.



Possible look of the new function - suggestion.jpg (58.28 KiB) Viewed 2665 times

Deeper and Better Category Module
Mass Product Price Change
Unlimited hosting with free domain and all extras

User avatar
New member


Thu Dec 01, 2011 3:04 pm
Location - Bulgaria

Post by IP_CAM » Sat Jun 16, 2018 8:10 am

Well, what keeps you from doing it ?! :o It could possibly even be offered as Extension. ;)
Still, to make such work in the first place, one could not just add another File, replacing
the Original, without making sure, that the new file would only consist out of exactly
the same 'Variables', in order to be 'understud' by the controller/language/model Files,
related to whatever File would be changed.

I would be surprised, if such a construction would not raise a lot of problems, since most
Buyers would expect it to work troughout the whole Scenario of OC Themes and Mods.
But go ahead, if you can do it, because OC won't, I assume ...
Good Luck! ;)

I am no longer active at the OC Forum, to reach me, contact:
My latest free Opencart LIGHT Source is available on demand:
900+ FREE OC Extension-Repositories - from OC v.1.5.x up, on the
world's largest OC-related Github Site:

User avatar
Legendary Member


Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 1 guest