dq13733519262 2012-12-11 15:01 采纳率: 0%
浏览 27
已采纳

如何在magento 1.7.0.2的简报中添加新字段(suscriber_name)?

I am trying to add a new field into newsletter subscription form. I have found this solution. But when I open the file mentioned in the answer ie Mage_Newsletter_Model_Mysql4_Subscriber (app/code/core/Mage/Newsletter/Model/Mysql4/Subscriber.php)

I looks like:

class Mage_Newsletter_Model_Mysql4_Subscriber extends Mage_Newsletter_Model_Resource_Subscriber
{
}

It confused me to modify the file. Can any one please guide how to achieve what I want?

  • 写回答

1条回答 默认 最新

  • douhuigang9550 2012-12-11 22:01
    关注

    The key to this is the class declaration:

    class Mage_Newsletter_Model_Mysql4_Subscriber extends Mage_Newsletter_Model_Resource_Subscriber
    

    Note the word extends? This means that this class inherits its functionality from the Mage_Newsletter_Model_Resource_Subscriber class. I would be looking at the app/code/core/Mage/Newsletter/Model/Resource/Subscriber.php file instead.

    The reason this is different to the solution you have found is that as of 1.6 Community Edition, the Mysql4 model was deprecated and Resource was used. This was to allow Magento to better support different database engines.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?