I am entirely new to Magento Development and I am attempting to add guest email signup ability to the Magento ProductAlert system. I have begun creating a module to extend the Mage_ProductAlert_AddController class and add functionality to the the stockAction function.
I have been looking at the Newsletter SubscriberController.php controller for inspiration on how to approach this issue while providing Zend_Validate, etc.
I have also created an email column within my product_alert_stock table.
I am now at a loss as to how to approach the rest of building out my module.
Best Answer
I've done this before, in short, you need to edit the following:
email
column to theproduct_alert_stock
table (you've already done this);FK_PRODUCT_ALERT_STOCK_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID
key on that same table;_prepareCollection
method ofMage_Adminhtml_Block_Catalog_Product_Edit_Tab_Alerts_Stock
to load the guest entries in the grid in the backend (found under the 'Product Alerts' tab at a product), by default this method only loads customers;send
method ofMage_ProductAlert_Model_Email
to send emails to guests, not only customers;_processStock
method ofMage_ProductAlert_Model_Observer
, to process the customers and guests that registered for a stock alert.That's all you need to do. I'm not throwing all the code at you, maybe you can figure it out for yourself now, if not, maybe I can add all the necessary code later if you'd like that.