1

I am trying to use VQMOD for the first time and when I added the code below to my page nothing changed.

I tried to change the home link on top right of home page (open cart) to my home, but the text did not change. Unfortunately, there was no error on the VQMOD manager.

My XML code is Below. Do I need to add something to my TPL or make any other changes?

<modification>
    <file name="catalog/view/theme/*/template/common/header.tpl">
        <operation>
            <search position="replace"><![CDATA[<?php echo $text_home; ?>]]></search>         
            <add><![CDATA[my home]]></add>   
        </operation>    
    </file>       
</modification>
john_science
  • 6,325
  • 6
  • 43
  • 60
Vallabh
  • 93
  • 2
  • 14
  • I've always had the same problem with vqmod, it's just totally unresponsive after install so I reverted to editing the files manually. Is this not an option for you? – Cleverbot Jul 13 '12 at 15:09
  • If you've not had anything happen with vQmod after you've installed it, then either the permissions were incorrect on the necessary folders or the install didn't occur on the `index.php` files – Jay Gilford Nov 25 '12 at 17:22

3 Answers3

3

You cannot able to replace the header.tpl as in your code. The VQMOD "Can only search single lines" not a particular variable.

Try this code:

<file name="catalog/view/theme/*/template/common/header.tpl">
    <operation>
        <search position="replace"><![CDATA[
          <div class="links"><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a><a href="<?php echo $wishlist; ?>" id="wishlist-total"><?php echo $text_wishlist; ?></a><a href="<?php echo $account; ?>"><?php echo $text_account; ?></a><a href="<?php echo $shopping_cart; ?>"><?php echo $text_shopping_cart; ?></a><a href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></div>
        ]]>
        </search>
        <add><![CDATA[
          <div class="links"><a href="<?php echo $home; ?>">your own link</a><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a><a href="<?php echo $wishlist; ?>" id="wishlist-total"><?php echo $text_wishlist; ?></a><a href="<?php echo $account; ?>"><?php echo $text_account; ?></a><a href="<?php echo $shopping_cart; ?>"><?php echo $text_shopping_cart; ?></a><a href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></div>
        ]]>
        </add>
    </operation>
</file>
John Melchior
  • 417
  • 2
  • 5
  • 22
1

The one thing I've spotted missing straight away is the modification details at the top are missing

<id>Mod Name</id>
<version>1.0.0</version>
<vqmver>2.X</vqmver>
<author>Your name</author>

You should really have this code too at the top of the xml file

<?xml version="1.0" encoding="UTF-8"?>
Jay Gilford
  • 15,141
  • 5
  • 37
  • 56
0

You have include() or require(), or require_once() in the *.tpl files

require ('catalog/view/theme/*/template/product/*.tpl');

modified to

require($vqmod->modCheck('catalog/view/theme/*/template/product/*.tpl'));

or

<?php
global $vqmod;
require($vqmod->modCheck('file/path/here'));
?>

or modify vqmod_opencart.xml

<file name="path/ *.tpl">
        <operation>
            <search position="replace" regex="true"><![CDATA[~require\(([^)]+)~]]></search>
            <add><![CDATA[require($vqmod->modCheck($1)]]></add>
       </operation>
</file>