|
EDIT: SEE MUCH BETTER SOLUTION HERE:
http://www.magentocommerce.com/boards/viewthread/24969/P15/#t234699
Hi Mislav,
I guess I’m too late for you,
but this is my solution:
In file \app\design\frontend\[default]\[default]\template\catalog\product\price.phtml
I added the code which checked the status of the customer (if it’s logged-out or if it should see Tax anyway).
add the code on line 50
<?php // **************************************************************** //
// if customer is logged-in, we get ID of the customer's group if ($this->helper('customer')->isLoggedIn()) $customerGroupTemp = Mage::getSingleton('customer/session')->getCustomerGroupId(); $setPercentageFlagTemp = false;
// Tax is shown if: // // -customer isn't logged-in OR // // -customer IS logged-in AND needs to see Tax (customers in groups: 1,5,6) // if ( (!$this->helper('customer')->isLoggedIn()) || ( ($this->helper('customer')->isLoggedIn()) && ( ($customerGroupTemp == 1) || ($customerGroupTemp == 5) || ($customerGroupTemp == 6) ) ) ) { $ctcTemp = 3; //int Customer Tax Class - "3 =with Tax", "5 = no Tax" $storeTemp = null; $includingTaxTemp = true; $shippingAddressTemp = null; $billingAddressTemp = null; $priceIncludesTaxTemp = null; $percentOLDTemp = $_product->getTaxPercent(); $requestTemp = Mage::getSingleton('tax/calculation')->getRateRequest($shippingAddressTemp, $billingAddressTemp, $ctcTemp, $storeTemp); $percentTemp = Mage::getSingleton('tax/calculation')->getRate($requestTemp->setProductClassId($_product->getTaxClassId())); $_product->setTaxPercent($percentTemp); $setPercentageFlagTemp = true; }
// **************************************************************** // ?>
and at the bottom of the file, after:
<?php endif; /* if (!$_product->isGrouped()): */ ?>
I added this code to reset the tax for that product (just in case)
<?php // **************************************************************** // // Set Tax % back to what it was // if($setPercentageFlagTemp) { $_product->setTaxPercent($percentOLDTemp); $setPercentageFlagTemp = false; } // **************************************************************** // ?>
So far it seems to be working for simple products, I haven’t tested for others.
I see both prices now on 1 product details, and products in grid/list (and some other modules that us this price.phtml file).
I used the same code for the issue when cart also displays prices without tax until My Cart or Checkout is clicked (see that post here:
http://www.magentocommerce.com/boards/viewthread/24969/). I used it in files
\app\design\frontend\[default]\[default]\template\catalog\product\view\addtocart.phtml
\app\design\frontend\[default]\[default]\template\catalog\product\list.phtml
before and after
<fieldset class="add-to-cart-box"> ............... </fieldset>
Good luck
|