문제

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

도움이 되었습니까?

해결책

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"

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top