我正在开发一个 opencart 项目。另一个开发人员实施的项目中有一个新的模块调用折扣。我已将相关文件和相关方法复制到一个新项目中,并且效果很好。我创建了一个包含与折扣模块相关的新文件的 discount.ocmod.zip 文件,并创建了 install.xml 文件来更新默认 php 文件(我正在更新product.php),但是在我安装之后扩展名,文件被复制到正确的位置,但product.php 没有更新我的新功能。 我在这里做错了什么?
这是修改日志。
这是我的 xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
-<modification>
<generator>Created with OpenIX - https://openix.io/en/tool/opencart/ocmod</generator>
<name>installment plan</name>
<version>0.1</version>
<code>20778</code>
<author>Thilina</author>
<link>www.test.com</link>
-<file path="admin/controller/catalog/product.php">
-<operation>
-<search>
-<![CDATA[// Image]]>
</search>
-<add position="before">
-<![CDATA[//Credit Cards
if (isset($this->request->post['credit_cards'])) {
$credit_cards = $this->request->post['credit_cards'];
} elseif (isset($this->request->get['product_id'])) {
$credit_cards = $this->model_catalog_product->getCreditCards();
} else {
$data['credit_cards'] = array();
}
$data['credit_cards'] = array();
foreach ($credit_cards as $credit_card) {
$data['credit_cards'][] = array(
'credit_card_id' => $credit_card['credit_card_id'],
'credit_card_name'=> $credit_card['credit_card_name']);
}
//Installment Plan Product Ids
if(!isset($this->request->get['product_id'])){
$data['installment_plans'] = array();
}else{
$data['installment_plans'] = $this->model_catalog_product->getInstallmentPlansOfProduct($this->request->get['product_id']);
}
]]>
</add>
</operation>
</file>
</modification>