0

I would like to have in my pages prices shown with and without vat. I set up that it shows both prices, but no matter what I do prices are always same. Check:

http://www.pro-orodje.si/montirke-centrirke/centrirni-stroji/avtomatski-centrirni-stroj-casb96an.html

  • with vat: 915€
  • without vat: 915€

915€ is price including vat. When I go to manage products-prices I have there a window where I put price inside it says: Price * 915 [EUR] [Inc. Tax]

What can I do to have different prices, so price with or without vat?

  • can you please tell us which magento? – Sunil Patel Jul 14 '17 at 12:38
  • Magento ver. 1.9.2.3 – klemen Jul 19 '17 at 10:29
1
<?php

$taxClassId = $_product->getData("tax_class_id");
$taxClasses = Mage::helper("core")->jsonDecode(Mage::helper("tax")->getAllRatesByProductClass());
$taxRate = $taxClasses["value_".$taxClassId];
$price_with_tax = $_product->getPrice();

$divided_value = 1+($taxRate/100);
$price_without_tax = $price_with_tax/$divided_value;
$price_without_tax_formatted = Mage::helper('core')->currency($price_without_tax, true, false);
echo $price_without_tax_formatted." exc GST";

?>
  • this code will get you price without TAX – Raghu Jul 15 '17 at 12:46
  • I need on my page price with and without vat. Because of law in Slovenia, I need to have both of them shown. I copy this to main folder? – klemen Jul 19 '17 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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