Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Display Prices Incl. / Excl. VAT depending on Customer Group
 
ixmir
Jr. Member
 
Total Posts:  1
Joined:  2013-01-07
 

Hello!

As far as I found out, in magento one can only set globally if prices should be displayed including or excluding VAT. What I (my customer) wants, is to set this differently for some customer groups.
I managed to do so by changing some functions in app/code/local/Mage/Tax/Model/Config.php

from:

public function displaySalesPricesInclTax($store null)
    
{
            
return Mage::getStoreConfig(self::XML_PATH_DISPLAY_SALES_PRICE$store) == self::DISPLAY_TYPE_INCLUDING_TAX;
    
}

    
public function displaySalesPricesExclTax($store null)
    
{
            
return Mage::getStoreConfig(self::XML_PATH_DISPLAY_SALES_PRICE$store) == self::DISPLAY_TYPE_EXCLUDING_TAX;
    
}

to:

public function displaySalesPricesInclTax($store null)
    
{
        $customer 
Mage::helper(\\\'customer\\\')->getCustomer();
        if (
$customer->getGroupId() == 6{
            
return 0;
        
else {
            
return Mage::getStoreConfig(self::XML_PATH_DISPLAY_SALES_PRICE$store) == self::DISPLAY_TYPE_INCLUDING_TAX;
        
}
    }

    
public function displaySalesPricesExclTax($store null)
    
{
        $customer 
Mage::helper(\\\'customer\\\')->getCustomer();
        if (
$customer->getGroupId() == 6{
            
return 1;
        
else {
            
return Mage::getStoreConfig(self::XML_PATH_DISPLAY_SALES_PRICE$store) == self::DISPLAY_TYPE_EXCLUDING_TAX;
        
}
    }

...and of course by changing the other relevant functions in this file the same way.

This works perfectly for frontend and cart, but not for creating PDF-invoices. I know, however, that this functions are used to create the invoices, as prices change, when i tell the functions to always return 0 or 1 - so it must be

$customer Mage::helper(\\\'customer\\\')->getCustomer();
that doesnt work in case of PDF-invoice generation.

PLS help - its driving me nuts!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top