1

I have a validations for customers. So, these validations or depending on Customer creating and updating.

Please let me know there is any chances to know weather there is customer is creating(registering) or updating(existing customer)?

Thanks in Advance.

1

You can observe the event customer_save_before.
You will get the current customer as a parameter(somehow) and you can check if the customer has an id.

something like this:

public function doSomething($observer) {
    $customer = $observer->getEvent()->getCustomer(); 
    if ($customer->getId()) {
         //is update mode
    }
    else {
        //is create mode
    }
}

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.