Friday, 5 January 2018

Product sort by PRICE - LOW TO HIGH AND HIGH TO LOW

Product sort by PRICE - LOW TO HIGH AND HIGH TO LOW

Please go to /app/design/frontend/default/your-theme/template/catalog/product/list/toolbar.phtml file and find the following code

<option value="<?php echo $this->getOrderUrl($_key, 'asc') ?>"<?php if($this->isOrderCurrent($_key)): ?> selected="selected"<?php endif; ?>>
    <?php echo $this->__($_order) ?>
</option>

Replace the following code


<?php if ($_order != 'Price'): ?>
<option value="<?php echo $this->getOrderUrl($_key, 'asc') ?>"<?php if($this->isOrderCurrent($_key)): ?> selected="selected"<?php endif; ?>>
    <?php echo $this->__($_order) ?>
</option>
<?php else: ?>
<option value="<?php echo $this->getOrderUrl($_key, 'asc') ?>"<?php if($this->isOrderCurrent($_key) && $this->getCurrentDirection() == 'asc'): ?> selected="selected"<?php endif; ?>>
    <?php echo $this->__($_order) . ': Low to High' ?>
</option>
<option value="<?php echo $this->getOrderUrl($_key, 'desc') ?>"<?php if($this->isOrderCurrent($_key) && $this->getCurrentDirection() == 'desc'): ?> selected="selected"<?php endif; ?>>
    <?php echo $this->__($_order) . ': High to Low' ?>
</option>
<?php endif; ?>

Wednesday, 5 July 2017

Magento 1.8.x or 1.9.x Payment not loading on Checkout

After look in everywhere I found out it was just an update on the layout. I went to /app/design/frontend/base/default/template/checkout/onepage/payment.phtml and changed that

<form action="" id="co-payment-form">
<fieldset>
<?php echo $this->getChildHtml('methods') ?>
</fieldset>
</form>

adding the id “checkout-payment-method-load” to fieldset

<form action="" id="co-payment-form">
<fieldset id="checkout-payment-method-load">
<?php echo $this->getChildHtml('methods') ?>
</fieldset>
</form>


That’s it. 

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;
}