0

we have shop where european company can checkout without tax if they have valid tax-number.

Problem is, that prices are shown without tax if a cutomer is logged in and has valid vat number. But we have added information "prices incl. tax". So this is wrong if customer has valid vat.

How can I disable showing prices in catalogue without tax. Or can I detect if customer has entered valid vat number so I can switch text "prices incl. tax -> prices excl. tax".

Thanks for help! Martin

1 Answer 1

0

I could solve it by switching text customer session group id:

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManager->get('Magento\Customer\Model\Session');
$customerData = $customerSession->getCustomer()->getData();  
if($customerData['group_id'] == '4')  {
    echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('blockexkl')->toHtml();
    }
else {
    echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('blockinkl')->toHtml();
}

where group id "4" is my customer group "Tax-free"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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