简体   繁体   English

修改需要唯一的ID码! Opencart OCMOD

[英]Modification requires a unique ID code! Opencart OCMOD

在 Opencart 2.0.1.1 中,我尝试上传具有正确名称格式.ocmod.xml的 OCmod 配置文件,但出现错误Modification requires a unique ID code!

Official guide for modifications of Opencart 2 is missing to mention about the <code> tag that should be included in all ocmod configuration files 修改 Opencart 2的官方指南缺少提及应包含在所有ocmod配置文件中的<code>标记

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 系统将此<code>标记与之前上传的修改文件进行匹配,以检查它是否已经上传,因此每次上传修改文件时都应将id放在<code>标记中,并且它应该是唯一的

So for solution you just need to add your unique modification ID between <code>HERE</code> and put that after the <modification> tag 因此,对于解决方案,您只需要在<code>HERE</code>之间添加唯一的修改ID,并将其放在<modification>标签之后

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>

You will have to put a Modification ID on any ocmod that you upload to your website, for example 例如,您必须在上传到您网站的任何ocmod上添加修改ID

 <code>00001</code>

If you upload other time this extension with modifications, you will have to put another code 如果您通过修改上传其他时间此扩展程序,则必须添加其他代码

 <code>00002</code>

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.我知道这不是您的问题,但有时此错误消息与扩展 ID 无关,另一个错误例如我在安装损坏的 ocmode 文件时使用 OC3.0.3.2 发生的情况,我忘记了标记,但我得到了同样的错误信息。

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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM