Adding a custom field to Magento's subscription module

后端 未结 4 644
小蘑菇
小蘑菇 2020-12-01 06:49

The newsletter subscription module in Magento has only one field (email) by default. After I add an extra field to the form (say country), how can I get the form data to sho

4条回答
  •  不知归路
    2020-12-01 07:45

    Adding to the accepted answer, you can also get away with this a little easier if you're adding a date, datetime, or timestamp-type column.

    In my case, I wanted to add a "Subscribed at Date" to my grid. To do this, I wrote my upgrade script, column type being TIMESTAMP and the default value being CURRENT_TIMESTAMP. This way, when the row is added, the current date/time is recorded.

    Then, all you have to do is add your block customizations. I'd suggest doing it by extending Magento's grid block rather than doing the local codepool override though. This way, you only need to override _prepareColumns();

提交回复
热议问题