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....

Sunday, 13 October 2013

Magento Reset "Use Secure in front end or Admin" in database

1. Open up your cPanel
2. Go to phpMyAdmin (if MySql)
3. Find your Magento Database
4. Find table 'core_config_data'
5. Look for the columns 'web/secure/use_in_frontend' and 'web/secure/use_in_adminhtml'
6. Edit both values, make them equal to '0'