Permalink
Browse files

Fixes #16 - suppress message to enter address for vat validation if a…

…ccount is inactive
  • Loading branch information...
Vinai committed Nov 24, 2013
1 parent 63ca6cf commit 8ca3a482fd4c38975cac7e33b024fa36215efb16
Showing with 11 additions and 1 deletion.
  1. +11 −1 app/code/community/Netzarbeiter/CustomerActivation/Model/Observer.php
@@ -85,10 +85,20 @@ public function customerSaveBefore($observer)
if (!$customer->getId()) {
$customer->setCustomerActivationNewAccount(true);
if (! (Mage::app()->getStore()->isAdmin() && $this->_checkControllerAction('customer', 'save'))) {
// Do not set the default status on the customer edit save action
// Do not set the default status on the admin customer edit save action
$groupId = $customer->getGroupId();
$defaultStatus = Mage::helper('customeractivation')->getDefaultActivationStatus($groupId, $storeId);
$customer->setCustomerActivated($defaultStatus);
if (! $defaultStatus) {
// Suppress the "enter your billing address for VAT validation" message.
// This setting will not be saved, its just for this request.
if (Mage::helper('customer/address')->isVatValidationEnabled($storeId)) {
Mage::app()->getStore($storeId)->setConfig(
Mage_Customer_Helper_Address::XML_PATH_VAT_VALIDATION_ENABLED, false
);
}
}
}
}
}

0 comments on commit 8ca3a48

Please sign in to comment.