[英]what and where to modify for Ocmod modification?
Ocmod文件用於更改opencart系統上的現有文件。 例如,如果您想更改checkout.php,則可以將其包含在ocmod文件中
<file path="catalog/controller/checkout/checkout.php">
<operation>
<search index="0"><![CDATA[public function index() {]]></search>
<add position="after"><![CDATA[
echo('This line will be added at the beginning of the index function');]]>
</add>
</operation>
</file>
結構大致如下
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id>For 2.1.0.2</id>
<name>Stack Overflow plug-in</name>
<code>Stack Overflow plug-in</code>
<version>1.1</version>
<vqmver></vqmver>
<author>Igor Savinkin</author>
<file path="catalog/controller/checkout/cart.php">
<operation>
<search index="0"><![CDATA[$data['continue'] = $this->url->link('common/home')]]></search>
<add position="before"><![CDATA[
//blah blah]]>
</add>
</operation>
<operation>
<search index="0"><![CDATA[unset($this->session->data['reward']);]]></search>
<add position="after"><![CDATA[
//blah]]>
</add>
</operation>
</file>
<file path="catalog/controller/product/product.php">
<operation>
<search index="0"><![CDATA[$this->load->model('catalog/product');]]></search>
<add position="replace"><![CDATA[
//etc]]>
</add>
</operation>
</file>
</modification>
然后,客戶端將在管理員的“擴展安裝程序”下上傳這些文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.