I'm trying to write my vqmod .xml, but nothing to work? if I try to add change in all catalog/* files. It works good for other (system/*, admin/*) files, but nothing changes? if I try to do something like this:
<file name="catalog/controller/checkout/cart.php">
<operation>
<search position="replace"><![CDATA[
$json['total'] = sprintf($this->language->get('text_items'), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0), $this->currency->format($total));
]]></search>
<add trim="true"><![CDATA[
$json['total'] = sprintf($this->language->get('text_items'), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0), $this->currency->format($total));
]]></add>
</operation>
</file>
what am I doing wrong?
Things to try:
Check whether vqmod is installed by calling
https://domain.com/vqmod/install in browser. If not installed, then
install and check.
Verify file name and path, also confirm that the code in search tag
exists in the file mentioned.
Check folder permissions. Make sure that vqmod/vqcache and
vqmod/logs have 755 or 777 permission. If nothing works, then try
777 permission recursively for vqmod folder.
Check the error logs in vqmod/logs.
Check the installed vqmod version and the vqmod version given in xml
file (<vqmver><![CDATA[version]]></vqmver>), both need to be the
same.
Delete the files in vqmod/vqcache and check again. Also see whether
vqmod copy of your file is generated or not.
Move any vqmod xml file outside the vqmod folder and check. If
everything works, move the xml back to the vqmod folder. I don’t
know the reason, but it worked for me in some cases :) !
<?xml version=”1.0″ encoding=”UTF-8″?> – put this line at the top of
the XML to make it valid and more compatible.
Try the VQMod Manager extension. It may help you!
Reference url: Opencart: Vqmod tutorial
Assuming the search can be found, you're not doing anything wrong. However, if it's only the catalog side that is having an issue, then it's most likely your opencart index.php for the catalog side doesn't have vQmod installed whereas the admin side does. Check your index.php file is correct. If that is written, then clear your vqcache folder to ensure it's actually writeable
Related
I'm using vQmod 2.5.1 and Opencart 2.0.3.1, and I've run into an interesting problem.
I've got a vQmod xml that makes some modifications to the system/library/cart.php file. Here's an example:
<file name="system/library/cart.php">
<operation>
<search position="after"><![CDATA[private $data]]></search>
<add><![CDATA[private $cr_prices = false;]]></add>
</operation>
</file>
I've placed this file in vQmod's xml directory and am not using OCmod at all for this. It was fine at first, but later I had to refresh Opencart's modification cache for another xml that uses OCmod, and suddenly my entire page broke.
It turns out OCmod created a copy of system/library/cart.php using the modifications from my vQmod xml, and then vQmod made a modification of that file, duplicating all the modifications. So the above modification created these two lines:
private $cr_prices = false;
private $cr_prices = false;
And I got a PHP error about redeclaring class properties.
Anyone run into this problem before or know how to fix it? Why is OCmod applying changes that are in the vqmod/xml directory?
Heh, after hours of pouring through the core code turns out this wasn't really a problem with vQmod nor with OCmod themselves, but with an extension I used to install vQmod. I completely forgot I had installed vQmod using this extension...
I have uninstalled the extension and have installed vQmod via the official tutorial:
https://github.com/vqmod/vqmod/wiki/Installing-vQmod-on-OpenCart
Now things are working as they should.
I am using Opencart 1.5.6.1 and VQMOD 2.4.1. I have just installed eWay Rapid 3.0 extension and in the checkout, I get this error:
Notice: Error: Could not load controller payment/eway!
in (.....)\vqmod\vqcache\vq2-system_engine_controller.php on line 47
Line 47 is trigger_error('Error: Could not load controller ' . $child . '!');
I'm not sure if this is something to do with VQMOD or eWay extension. Does anyone have any idea how to resolve this?
Steps to try:
Check whether you've a file named eway.php in catalog/controller/payment folder.
Verify the class name of that file: class ControllerPaymentEway extends Controller {.
Check the file permission.
Have a nice day!!
Just got a solution to this, see here.
Described solution:
New function hasAction in system/engine/controller.php missing global $vqmod;
Edit vqmod/xml/vqmod_opencart.xml
For <file name="system/engine/controller.php">
Change:
<search position="before" index="1"><![CDATA[$vqmod->modCheck($action->getFile()]]></search>
Into
<search position="before"><![CDATA[if (file_exists($vqmod->modCheck($action->getFile()))) {]]></search>
I had the same error as you on 1.5.6 and VQMOD 2.4.
The error appeared because I had previously installed an older version of the official eWay module.
This old version of the module left over a folder in catalog\controller\payment\eWay folder.
Delete this eway subfolder as the only eWay file here should be catalog\controller\payment\eway.php
It seems that the controller function gets confused and tried to load the folder instead of the sway.php file.
This fixed the problem for me using eWay Rapid 3.1 Transparent Direct Version.
Best of Luck!
Oliver
I am writing VQMod XML to edit config.php in opencart, i wrote below XML and saved it inside XML folder.
<modification>
<id>VQMOD CORE FOR OPENCART - DO NOT REMOVE</id>
<version>1.4.x and 1.5.x</version>
<vqmver>2.2.1</vqmver>
<author>Senthil</author>
<file name="./config.php">
<operation>
<search position="after"><![CDATA[
define('DB_PREFIX', 'op');
]]></search>
<add><![CDATA[
define('HTTP_IMAGE_2', 'http://localhost/opcart/image/');
define('HTTPS_IMAGE_2', 'http://localhost/opcart/image/');
define('DIR_IMAGE_2', '/Users/[username]/Sites/opcart/image/');
]]></add>
</operation>
</file>
But its not creating new cache file in vqcache folder as its doing for other files. No errors in log file. I have write permission to the vqcache folder and config file. Any help will be useful.
vQmod's do not work on those files. It works basically on all php/tpl files above the index.php folder (ie 1 or more files deeper)
Yes this is possible. You can use VQMod everywhere that a file is accessed, as long as there is a logical chain of "touch" to that file and no rogue requires. In this case, this is semi-untested beyond a dev instance, and there are "security" risks involved with making configs moddable.
To do it, you just need to edit index.php (and admin/index.php). Move the following to the top of of the index.php's (under define VERSION) so that it comes before the check for config.php's:
// VirtualQMOD
require_once('./vqmod/vqmod.php');
VQMod::bootup();
Then change the way OC is pulling config.php:
require_once('config.php');
By adding in the check for mods:
require_once(VQMod::modCheck('config.php'));
Access your catalog/admin so VQ can build, then check /vqmod/vqcache for file:
vq2-config.php
If it's there, and your changes are in, success.
PS: You can just use <file name="config.php"> in your XML file, no need for the relative ./.
I've been trying to install the Cookie Control Joomla module, I've tried all three methods of installing (Upload, Directory, URL). Each time I try it comes back with the error
"Error! Could not find a Joomla! XML setup file in the package."
There is definitely an XML file in the root, and I have downloaded from here:
http://www.joostrap.com/civic-cookie-control-joomla-module
Does anyone know of common errors for this or, why this maybe happening with this module?
I'm running Joomla v1.5 and have installed extensions before, but never with errors.
You are getting this error upon installation because the module is for Joomla 2.5, not 1.5.
Im not sure if converting the extension to 1.5 will still work, but could be worth a try. From what I can see, the only file you need to change is the XML.
<extension to <install
version="2.5" to version="1.5"
Remove the <config> tags
Remove <fields name="params">
Change <fieldset name="basic"> to <params>
Change all the <field> tags to <param>
Or you could have a look on the Joomla Extensions Directory for 1.5 compatible extensions
In Adobe ColdFusion (ACF), I've always used cffile action="rename" to move both files and directories. Not unreasonably, Railo doesn't think cffile applies to directories, so you need to use cfdirectory rename, and that works fine. However, that doesn't appear to work in ACF.
For example:
<cfdirectory action="RENAME" directory="C:/tmp/aaa1/aaa2/" newDirectory="C:/tmp/aaa2">
...works in Railo, but in ACF throws this:
The specified directory attribute C:/tmp/aaa1/aaa2/ cannot be renamed to newdirectory C:\tmp\aaa1\C:\tmp\aaa2.
So it seems you'd have to use cffile to move directories on ACF, and cfdirectory on Railo.
Is that really the state of the art? Is there some way to get cfdirectory to move a directory on ACF?
It shouldn't matter, but it works if you use backslashes.
I'd class this as a bug in CF (I'm testing with CF9.0.1) as for all other file operations I am aware of, either slash works fine on CF.
We developed an application in CF10 that used forward slashes for the file path in cfdirectory action="rename".
<cfdirectory action="rename" directory="//fileserver/folder10/test/TEST74036JJ_CW" newdirectory="//fileserver/folder10/TEST74036JJ_CW">
This code appeared to run fine in CF10.
When we moved the code to a CF8 server, we received the same error with the newdirectory path being appended on to the end of the original directory.
The specified directory attribute //fileserver/folder10/test/TEST74036JJ_CW cannot be renamed to newdirectory \\fileserver\folder10\test\fileserver\folder10\TEST74036JJ_CW
So, it does appear that CF10 can now handle forward slashes for cfdirectory action="rename".
I get a solution only with a change. On the attribute newDirectory do not write the path, only write the new folder name and ready. Try it. This was the option for me. I use coldfucion 9.0.1