In Opencart 2.0.1.1, I tried to upload an OCmod configuration file with right name format .ocmod.xml
but I get the error Modification requires a unique ID code!
4 Answers
Official guide for modifications of Opencart 2 is missing to mention about the <code>
tag that should be included in all ocmod
configuration files
The system match this <code>
tag with previously uploaded modification files to check if it has already been uploaded or not so every time you upload a modification file you should put the id
in <code>
tag and it should be unique
So for solution you just need to add your unique modification ID between <code>HERE</code>
and put that after the <modification>
tag
like this
<?xml version="1.0" encoding="utf-8"?>
<modification>
<code>Modification ID</code>
<name>Modification</name>
<version>1.0</version>
<author>Author Name</author>
<link>http://www.author.com</link>
<file path="catalog/controller/common/home.php">
<operation>
<search><![CDATA[
Search this
]]></search>
<add position="replace"><![CDATA[
replace with this
]]></add>
</operation>
</file>
</modification>

- 921
- 2
- 11
- 29
-
You should have warned the contributors about it, I've opened an issue at the repo: https://github.com/opencart/opencart/issues/4099 – giovannipds Mar 11 '16 at 19:46
-
1Oh yes that would have been better – Muhammad Mar 11 '16 at 19:47
-
help me to get some attention there, the people there seem to be giving a shit about it...... sad!! Please help there. Thanks! – giovannipds Jul 04 '16 at 18:44
-
@GiovanniPiresdaSilva yes I read it they don't know what we are asking from them – Muhammad Jul 04 '16 at 18:47
You will have to put a Modification ID on any ocmod that you upload to your website, for example
<code>00001</code>
If you upload other time this extension with modifications, you will have to put another code
<code>00002</code>

- 323
- 3
- 10
I know this wasn't your problem, but sometimes this error message has no relation with the extension id, another error for example what happened with me with OC3.0.3.2 while installing a corrupted ocmode file, I forgot tag and I got the same error mesage.
my corrupted file looked like this:
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Cart Modificationso</name>
<code>ocart-modif</code>
<version>1.2</version>
<author>ssss</author>
<link>https://websitg.com.tr</link>
<file path="system/library/cart/cart.php">
<operation>
<search><![CDATA[public function getProducts() {]]></search>
<add position="before"><![CDATA[
public function func($productID,$quantity){
return "test";
}
]]></add>
</file>
</modification>

- 887
- 12
- 32