Friday, 27 November 2015

Magento Pdf attached not sending and pdf invoice not working

This an incompatibility issue between PHP Version 5.4.4 and zend Framwork .

Fixed it by change in this function lib/Zend/Pdf/FileParserDataSource.php.

change

abstract public function __construct();
or
abstract public function __destruct();
to

abstract public function __construct($filePath);

Friday, 9 October 2015

magento get table prefix

Use this following code you will get the prefix.
echo Mage::getSingleton('core/resource')->getTableName('core_config_data');

Friday, 2 October 2015

Magento add next and previous link on product details page

Please add the following codes under the view.phtml

<?php
  function getPreviousProduct()
    {
        $prodId = Mage::registry('current_product')->getId();

        $catArray = Mage::registry('current_category');

        if($catArray){
            $catArray = $catArray->getProductsPosition();
            $keys = array_flip(array_keys($catArray));
            $values = array_keys($catArray);

            $productId = $values[$keys[$prodId]-1];

            $product = Mage::getModel('catalog/product');

            if($productId){
                $product->load($productId);
                return $product->getProductUrl();
            }
            return false;
        }

        return false;

    }


  function getNextProduct()
    {
        $prodId = Mage::registry('current_product')->getId();

        $catArray = Mage::registry('current_category');

        if($catArray){
            $catArray = $catArray->getProductsPosition();
            $keys = array_flip(array_keys($catArray));
            $values = array_keys($catArray);

            $productId = $values[$keys[$prodId]+1];

            $product = Mage::getModel('catalog/product');

            if($productId){
                $product->load($productId);
                return $product->getProductUrl();
            }
            return false;
        }

        return false;
    }


?>
<?php $_prev = getPreviousProduct(); ?>
<?php $_next = getNextProduct(); ?>

Friday, 7 August 2015

Clearing or Updating Cart Issues Following Magento 1.9 Upgrade

Please add the following line under the <form> tag.
File path - app/design/frontend/default/[you theme name]/template/checkout/cart.phtml file

<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />

if there is login issues then please add the following code in the login page which is under persistent folder.

<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" /> 

Friday, 24 July 2015

magento order confirmation email is not sent

Just do a small change in order.php (public_html/app/code/core/Mage/Sales/Model/Order.php)

From

$mailer->setQueue($emailQueue)->send();
To

$mailer->send();

2nd way to fix the email sending issues if the first one didn't worked.

If the email is still not sending then kindly use this change this code, it will work as well.

Copy: app/code/core/Mage/Sales/Model/Order.php

Into: app/code/local/Mage/Sales/Model/Order.php

on line 1275 (Magento 1.9.0.1), comment out return $this;

if ($this->getEmailSent()) {
    //return $this;
}

magento customer login is not working

Go to /app/design/frontend/default/yout theme/template/persistent/customer/form/login.phtml

and add the following line under the <form> tag

<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />

Tuesday, 9 June 2015

magento new product OptionTemplateSelect is not defined

go to below directory:
app/design/adminhtml/default/default/template/catalog/product/edit/options/type/

and just rename this file “select.phtml0000664″ to “select.phtml” and that’s it.