5

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!

Mureinik
  • 297,002
  • 52
  • 306
  • 350
Muhammad
  • 921
  • 2
  • 11
  • 29

4 Answers4

16

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>
Muhammad
  • 921
  • 2
  • 11
  • 29
1

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>
ber2008
  • 323
  • 3
  • 10
0

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>
mfadel
  • 887
  • 12
  • 32
-2

It may also happens if any syntax error present in xml file. I had and found it.

Abish R
  • 17
  • 3