Magento configrable product get child product by super attribute php code

Puneet Kumar Magento Developer

Magento create block from controller php code


this code write in your controller you have to no write in xml layout
Puneet Kumar Magento Developer

How to add custom fields for Order Line Items in magento

Puneet Kumar Magento Developer

Remove precision from price of a product

Remove precision from price of a product

 

As I said in the title, I want to remove precision from price ( .00 )

I did these :

  1. In app/code/core/Mage/Directory/Model/Currency.php

in

public function format()

I changed

 return $this->formatPrecision($price, 2, $options, $includeContainer, $addBrackets);

to

 return $this->formatPrecision($price, 0, $options, $includeContainer, $addBrackets);
  1. In /app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php

in

public function getEscapedValue()

I changed

 return number_format($value, 2, null, '');

to

 return number_format($value, 0, null, '');
  1. In js/varien/js.js

I changed

var precision = isNaN(format.precision = Math.abs(format.precision)) ? 2 : format.precision;
var requiredPrecision = isNaN(format.requiredPrecision = Math.abs(format.requiredPrecision)) ? 2 : format.requiredPrecision;

to

var precision = 0;
var requiredPrecision = 0;
  1. And in app/code/core/Mage/Core/Model/Store.php

I changed

public function roundPrice($price)
    {
        return round($price, 2);
    }

to

 public function roundPrice($price)
    {
        return round($price, 0);
    }

Then I cleared the cache, and reindexed Magento (which is i
version1.9), But the precision didn’t remove, Am I missing something?
what should I do?

 

 

i am using its working thank bro

Puneet Kumar Magento Developer

Magento add new class accourding to your module and you

add class with php

if ($root = $this->getLayout()->getBlock('root')) {
    $root->addBodyClass('whatever');
}
 
and xml
 
<reference name="root">
    <action method="addBodyClass"><classname>whatever</classname></action>
</reference> 
Puneet Kumar Magento Developer

Magento Mask product set attribute value

Magento Mask product set attribute value

Puneet Kumar Magento Developer

States if India not displaying in dropdown list during checkout process in magento 1.7.0.2

States if India not displaying in dropdown list during checkout process in magento 1.7.0.2

Puneet Kumar Magento Developer

magento log clear query

Puneet Kumar Magento Developer

magento order viedw how to add new filster coloume ?

magento order viedw how to add new filster coloume ?
Puneet Kumar Magento Developer

Magento how to mail in magento php script

Magento how to mail in magento php script ?

Puneet Kumar Magento Developer