Permalink
Browse files

Bugfix for older Magento versions not having vat validation

  • Loading branch information...
1 parent 555bf0d commit b5eea761535e695e639b4d292b9fb382556bb0d9 @Vinai committed Jan 9, 2014
Showing with 9 additions and 4 deletions.
  1. +9 −4 app/code/community/Netzarbeiter/CustomerActivation/Model/Observer.php
View
13 app/code/community/Netzarbeiter/CustomerActivation/Model/Observer.php
@@ -93,10 +93,15 @@ public function customerSaveBefore($observer)
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
- );
+ $helper = Mage::helper('customer/address');
+ if (method_exists($helper, 'isVatValidationEnabled')) {
+ if (is_callable(array($helper, 'isVatValidationEnabled'))) {
+ 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 b5eea76

Please sign in to comment.