Magento – Are Stock and Price Alerts Ever Removed?

alertce-1.8.1.0ee-1.13product

The Mage_ProductAlert module sends product alerts to customers and updates the sent records in the tables product_alert_price and product_alert_stock. However, I was looking for any processes that remove old records but couldn't find anything related to that respect. Are these records ever removed once their corresponding emails are sent?

Best Answer

Assuming, magentos modularization is good on this extension (Mage_ProductAlert), no they are never deleted. If you search the module for delete you get a few results in the UnsubscribeController - when the customer deletes manually.

Automatically I can not find anything.

And while reading the code I found a bug:

\Mage_ProductAlert_UnsubscribeController::priceAllAction
public function priceAllAction()
{
    $session = Mage::getSingleton('customer/session');
    /* @var $session Mage_Customer_Model_Session */

    try {
        Mage::getModel('productalert/price')->deleteCustomer(
            $session->getCustomerId(),
            Mage::app()->getStore()->getWebsiteId()
        );
        $session->addSuccess($this->__('You will no longer receive price alerts for this product.'));

This success message should be You will no longer recieve price alerts. because the code deletes them all, not only for one product :D

Related Topic