1

I'm try to figure out how to show/hide things if the customer hasn't verified their Tax/VAT number. Very much in a similar way to showing/hiding things if the customer isn't logged in (code below)

<?php
if(!Mage::getSingleton('customer/session')->isLoggedIn()){

I can find this in the controller

protected function _isVatValidationEnabled($store = null)
{
    return  $this->_getHelper('customer/address')->isVatValidationEnabled($store);
}

So I have tried these but with no luck

if($this->_getHelper('customer/address')->isVatValidationEnabled($store)){

if(!Mage::_getHelper('customer/address')->isVatValidationEnabled()){

Any ideas how I might get it working?

2

If you are in the EU you should just enable VAT validation and auto assign to groups based upon VAT validation result. If you are outside the EU and Magento won't deliver any automatic VAT validations you can assign the customers individually to their respective groups.

If this now is, you can customize your e.g. PHTML based upon the group the customer belongs to and can hide/show things.

I'm guessing it's for prices incl/excl taxes? If so you can solve this via the customer groups itself.

| improve this answer | |
0

This was the answer to my question, it checks for the login and then checks for a customer group id too

<?php       
    $_isLoggedIn = $this->helper('customer')->isLoggedIn();
    if($_isLoggedIn == true){
    $_myGroupId = Mage::getSingleton('customer/session')->getCustomerGroupId();          
    if($_myGroupId == 5){
    ?><div class="special"> </div><?php
            }
        }
?>
| improve this answer | |

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.