1
我試圖通過重寫類Mage_Eav_Model_Entity_Type來覆蓋Magento訂單號創建。Magento:重寫Mage_Eav_Model_Entity_Type
應用程序/代碼/本地/自定義/ MyModule中/型號/實體/ Type.php:
<?php
class Custom_MyModule_Model_Entity_Type extends Mage_Eav_Model_Entity_Type {
public function fetchNewIncrementId($storeId = null) {
$incrementId = parent::fetchNewIncrementId($storeId);
$incrementId = 'test' . $incrementId;
return $incrementId;
}
}
但我應該怎麼寫應用程序/代碼/本地/自定義/ MyModule中的/ etc/config.xml中?請參閱下面的TODO1和TODO2。
<?xml version="1.0"?>
<config>
<modules>
<Custom_MyModule>
<version>1.0.0</version>
</Custom_MyModule>
</modules>
<global>
<models>
<TODO1>
<rewrite>
<TODO2>Custom_MyModule_Model_Entity_Type</TODO2>
</rewrite>
</TODO1>
</models>
</global>
</config>
就像一個魅力。謝謝! – haba713