Tuesday, 18 February 2014

Magento Configuration product wrong price issues in create new order


1) Go to app\code\core\Mage\Sales\Model\Quote\Item\ then open Abstract.php page.
2) Write the following code in the public function getPrice() (line no - 484)


$_Pdetails = Mage::getModel('catalog/product')->loadByAttribute('sku',$this->_getData('sku'));
 return $_Pdetails->getFinalPrice();


Code should be


public function getPrice()
    {
$_Pdetails = Mage::getModel('catalog/product')->loadByAttribute('sku',$this->_getData('sku'));
                return $_Pdetails->getFinalPrice();  // Debendra on 17/02/2014
       /* Orginal Code
return $this->_getData('price');
*/
    }



Now the correct product price is going to show in the admin panel, when you create one order (Phone order).

Wednesday, 22 January 2014

Magento Tax Round Issue

Go to app\code\core\Mage\Core\Model\Store.php

Find the following function


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

Change to:-


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



Enjoy..........

Thursday, 14 November 2013

magento get all available shipping methods


function getAllAvailableShippingMethod()
{
$methods = Mage::getSingleton('shipping/config')->getActiveCarriers();
$shipMethods = array();
foreach ($methods as $shippigCode=>$shippingModel)
{
    $shippingTitle = Mage::getStoreConfig('carriers/'.$shippigCode.'/title');
    $shipMethods[$shippigCode] = $shippingTitle;
}
return $shipMethods;
}

Magento get all available payment method


function getAllAvailablePaymentMethod()
{
$payments = Mage::getSingleton('payment/config')->getActiveMethods();
$payMethods = array();
foreach ($payments as $paymentCode=>$paymentModel)
{
    $paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title');
    $payMethods[$paymentCode] = $paymentTitle;
}
return $payMethods;
}









Monday, 21 October 2013

Magento connect manager problem

If magento connect manager having problem whenever install any extension then go through following steps.

1) Remove Cache
2) Remove your browser cookie
3) Go to "downloader" folder and remove the "cache.cfg" & "connect.cfg" files as well.

Then logged into your magento connect manager. and enjoy.....








magento remove configurable product price from dropdown in admin panel

Go to app\design\adminhtml\default\default\template\catalog\product\composite\fieldset\configurable.phtml

Replace the script code



<script type="text/javascript">
   // var config = <?php echo $this->getJsonConfig() ?>;


Product.Config.prototype.formatPrice = function(){ return ''; }
var config = new Product.Config(<?php echo $this->getJsonConfig() ?>);



    if (window.productConfigure) {
        config.containerId = window.productConfigure.blockFormFields.id;
        if (window.productConfigure.restorePhase) {
            config.inputsInitialized = true;
        }
    }
    ProductConfigure.spConfig = new Product.Config(config);
</script>

Then  enjoy....