Editing tb_themes admin template files with vqmod

ThemeBurn SupportForumsOpenCart ThemesShoppica 2 OpenCart ThemeEditing tb_themes admin template files with vqmod

This topic has been marked as not resolved.

Hello

I am working on a new website which runs on Opencart 1.5.4.1, Shoppica 2.2.0 and VQMOD 2.1.7.

I have a small problem concerning the ability to edit files within the following directory: ‘tb_themes/shoppica2/admin/view/template/’.

I have found the following post while searching for a solution but that doesn’t offer a solution to the problem I’m facing: http://support.themeburn.com/topic/vqmod-for-tbcontroller-php-in-shoppica-2

My VQMod script does succesfully edit a few .php files within the ‘tb_themes’ folder but it just seems to ignore every .tpl file within the ‘template’ directory. I tried the most simple replace imaginable on several files within that folder to make sure that it wasn’t due to a mistake I made.

My question now is, is it possible to edit the .tpl files too using VQMod or can I just edit .php files? Shoppica-specific files which I am able to edit are for example:

tb_themes/shoppica2/admin/plugin/FooterInfoPlugin.php
tb_themes/shoppica2/admin/language/english/theme.lang.php

Thanks in advance for your assistance

With kind regards

Aad Wagner

  • This reply was modified 4222 days ago by  aadwagner.
  • This reply was modified 4222 days ago by  aadwagner.
  • This reply was modified 4222 days ago by  aadwagner.
  • This reply was modified 4222 days ago by  aadwagner.
October 10, 2012 at 3:31 pm #14180

You should be able (assuming you are using vqmod correctly) to edit all of the files from the catalog/view/theme/shoppica2/template folder. There is no difference with other themes here (including the default one) – the .tpl files are loaded from opencart.

You should also be able to edit most of the files from the tb_themes folder. We have added a vqmod check.

The only files you can’t change with vqmod reside in tb_themes/shoppica2/library/ThemeManager.php

Regards,
ThemeBurn team

October 11, 2012 at 11:12 am #14214

Thank you for your reply,

I am well aware that I can change any catalog theme files inside the catalog/view/theme/shoppica2/template folder. I am however interested in editing the .tpl files used by the shoppica2 admin module within the tb_themes/shoppica2/admin/view/template folder.

As an example, you could use the attached script. It edits both a .tpl file used by the catalog and a .tpl file used by the shoppica2 module in the admin section.


<file name="catalog/view/theme/shoppica2/template/common/footer.tpl">
        <operation>
            <search position="after"><![CDATA[<p id="copy"><?php echo $powered; ?></p>]]></search>
            <add><![CDATA[
            <p>test</p>
            ]]></add>
        </operation>
    </file>

    <file name="tb_themes/shoppica2/admin/view/template/theme_footer.tpl">
        <operation>
            <search position="after"><![CDATA[<div id="footer_twitter_settings">]]></search>
            <add><![CDATA[
            <p>test</p>
            ]]></add>
        </operation>
    </file>

When I access the front-end the cached file is generated and I can see that my modification succeeded. However, when I go to the page which uses the shoppica2 admin .tpl no cached file is generated, no error is added to the vqmod log and I can see no modification on the page itself.

Is there something I am just overlooking or are there more files inside the ‘tb_themes’ folder which you cannot change with vqmod?

Thanks again

  • This reply was modified 4218 days ago by  aadwagner.
October 14, 2012 at 3:05 pm #14322

Open tb_themes/shoppica2/library/AdminController.php, find this row:

require($template_file);
and replace it with:

require(TB_Utils::vqmodCheck($template_file));

Your vqmods for the tb_themes/shoppica2/admin/view/template/ folder should work now.

We will include this in the next Shoppica update.

Regards,
ThemeBurn team

October 19, 2012 at 10:24 am #14482

Hi

Thank you for your reply. Your solution does seem to allow me to edit any .tpl file invoked by the AdminController although the file I am trying to modify with VQMOD is being required inside the ‘theme.tpl’ file itself by a ‘require’ so it does not get processed by your suggested change.

October 21, 2012 at 3:52 pm #14558

Open the tb_themes/shoppica2/admin/view/template/theme.tpl file and replace any

<?php require 'theme_xyz.tpl'; ?>
with

<?php require(TB_Utils::vqmodCheck(dirname(__FILE__) . '/theme_xyz.tpl')); ?>

October 23, 2012 at 12:01 pm #14587
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.