Reputation: 33
I am trying to mod the admin in OpenCart (3.0.1.1) slightly. I have written the following XML code as a test to see if I can mod the product form:
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Test</name>
<code>Test</code>
<version>1.0</version>
<author>Test</author>
<link>http://web.com</link>
<file path="admin/view/template/catalog/product_form.twig">
<operation>
<search><![CDATA[
<div id="content">
]]></search>
<add position="replace"><![CDATA[
<div id="content" class="yeah">
]]></add>
</operation>
</file>
</modification>
Because I can't get the Extensions Installer to upload an XML file (separate issue) I have to save the xml file and install.xml in a folder along side an empty upload folder and then zip the parent folder like you would with a more complex mod. This works - ie it uploads and installs:
I then go to the Modification List and refresh to see there is nothing there (an no reference in the Log either):
And, of course, the mod hasn't worked:
Any ideas?
Upvotes: 0
Views: 1936
Reputation: 1
I am explaining by example
Suppose we have an extension that has the following files as upload install.xml
then we need to zip both files as extension_name.ocmod.zip. But if we extract this zip file, then files should not be extracted in the extension_name directory.
The .ocmod.zip file should contain the following at its root: upload install.xml
Hope it will solve your issue
Upvotes: 0
Reputation: 1430
do not leave spaces in search tags. The code should look like this: <?xml
version="1.0" encoding="utf-8"?>
<modification>
<name>Test</name>
<code>Test</code>
<version>1.0</version>
<author>Test</author>
<link>http://web.com</link>
<file path="admin/view/template/catalog/product_form.twig">
<operation>
<search><![CDATA[<div id="content">]]></search>
<add position="replace"><![CDATA[
<div id="content" class="yeah">
]]></add>
</operation>
</file>
</modification>
Upvotes: 0
Reputation: 99
3.x support only archived files, You need to archive the file before upload . eg: change the xml file name to 'install.xml' then archive the file as filename.ocmod.zip.
Upvotes: 3