Question

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

Was it helpful?

Solution

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"

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top