0

I want to know location of function when customer is deleted from:

  1. Multiple customer selected and select delete action on "Manage Customer" page.
  2. Delete single customer from "Edit Customer" page.
0

Mass delete:

app/code/core/Mage/Adminhtml/controllers/CustomerController.php => massDeleteAction()

Delete single customer:

app/code/core/Mage/Adminhtml/controllers/CustomerController.php =>deleteAction()

0

In app/code/core/Mage/Adminhtml/controllers/CustomerController.php

public function massDeleteAction()
{
    $customersIds = $this->getRequest()->getParam('customer');
    if(!is_array($customersIds)) {
         Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select customer(s).'));
    } else {
        try {
            $customer = Mage::getModel('customer/customer');
            foreach ($customersIds as $customerId) {
                $customer->reset()
                    ->load($customerId)
                    ->delete();
            }
            Mage::getSingleton('adminhtml/session')->addSuccess(
                Mage::helper('adminhtml')->__('Total of %d record(s) were deleted.', count($customersIds))
            );
        } catch (Exception $e) {
            Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
        }
    }

    $this->_redirect('*/*/index');
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.