2017-06-21 96 views
0

我正在通过opencart教程,当我尝试上传修改时,出现以下错误:"Modification requires a unique ID code!"。修改有<code>标记。我使用的是opencart 2.3.0.2。上传ocmod.xml文件时出现“opencart修改需要唯一的ID代码”

修改的代码:

<modification> 
<name>Add Header Notification in the catalog and admin pages</name> 
<version>1.0</version>     
<link>http://isenselabs.com</link>     
<author>iSenseLabs</author>                 
<code>new_u_name</code> 
<file path=”admin/view/template/common/header.tpl”> 
    <operation>   
     <search>  
      <![CDATA[<header id=”header” class=”navbar navbar-static-top”>]]>  
     </search>  
     <add position=”replace”>    
      <![CDATA[     
       <div id=”HeaderNotification” style=” background-color: #F54661; z-index- :99999;font-size:22px; 
       text-align:center; color:#fff; position:fixed;width:100%;height: 40px- ;line-height:40px;top:0px;”> 
       Header Notification in Your Admin Panel</div><header id=”header” class=”navbar navbar-static-top” style=”margin-top:40px;”>   
       ]]>   
     </add>  
    </operation> 
</file> 
<file path=”catalog/view/theme/*/template/common/header.tpl”>  
    <operation>   
     <search> 
      <![CDATA[</head>]]>   
     </search>   
     <add position=”after”>    
      <![CDATA[     
      <div id=”HeaderNotification” style=” background-color: #F54661; z-index:99999;font-size:22px; 
      text-align:center; color:#fff; position:fixed;width:100%;height: 40px;line-height:40px;top:0px;”>Header 
      Notification in Your Store</div><header id=”header” class=”navbar navbar-static-top” style=”margin-top:40px;”> 
      ]]> 
     </add>  
    </operation> 
</file> 

回答

0

万一别人运行到这一点,例如是从书“Opencart的技巧和窍门”,当你复制粘贴代码你错了双引号大约在”after”。重新报价可以解决问题。