1

I have a shop that uses prices excl tax. I want to add the price incl. tax below the price field as text (not as an editable field or an attribute, just an information).

I've already added a new column to the product grid that shows the price incl tax (using a renderer that returns $this->helper('tax')->getPrice($product, $product->getFinalPrice(), true);)

But I just can't figure out how to get this working on the product edit price tab? If I had to add an attribute I think it could be added in the Attributes.php (Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes), but can I add an info-block/comment/line of text?

It doesn't have to calculate it realtime the price when you enter a price in the price field, just on save/load of the product (with php)?

To sum up, how do i add a custom comment/info text below the price field?

I want to show $this->helper('tax')->getPrice($product, $product->getFinalPrice(), true); in this comment/info text.

1 Answer 1

0

Found a way.

Just added the following to Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price:

... // after: if (Mage::helper('tax')->priceIncludesTax($store)) ...
else if ($this->getId() == 'price'){
        $product = Mage::registry('current_product');
        $price = Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), true);
        $format = Mage::helper('core')->formatPrice($price, false);
        $html.= ' <strong>Price inkl. tax: '.$format.'</strong>';
    }

Your Answer

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

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