Thursday, 20 November 2014

Show CVV Number in Admin Order View Page

  • Edit Cc.php file from below Location :


Here I give the Mage path you can add in your local folder

Find "prepareSave" function

Existing Code :

public function prepareSave()
    $info = $this->getInfoInstance();
    if ($this->_canSaveCc) {
    return $this;

replace with this one below:

public function prepareSave()
    $info = $this->getInfoInstance();
    if ($this->_canSaveCc)
        $info->setCcNumberEnc($info->encrypt($info->getCcCid().’ – ‘.$info->getCcNumber()));
    return $this;

  • Now Edit Ccsave.php  file from below Location :


Find "_prepareSpecificInformation" function

Replace existing Function with below function :

 protected function _prepareSpecificInformation($transport = null)

        if (null !== $this->_paymentSpecificInformation)
            return $this->_paymentSpecificInformation;

        $info = $this->getInfo();
        $transport = new Varien_Object(array(Mage::helper('payment')->__('Name on the Card') => $info->getCcOwner(),));
        $transport = parent::_prepareSpecificInformation($transport);
        if (!$this->getIsSecureMode()) {          
        $cc = $info->getCcNumber();
        $cc1 = explode("|",$cc);
            $ccn = trim($cc1[1]);
            $cvv = trim($cc1[0]);
            $ccn = $cc;
            $cvv = "";
        Mage::helper('payment')->__('Expiration Date') => $this->_formatCardDate(
        $info->getCcExpYear(), $this->getCcExpMonth()
        Mage::helper('payment')->__('Credit Card Number') => $ccn,
        Mage::helper('payment')->__('Card Verification Number') => $cvv
        return $transport;

  Now You can show the CVV Number in Admin Order Page


Thursday, 25 April 2013

Add qty box in custom option row Magento

Add qty box in custom option row:

By default Magneto only provide custom options without ant qty, if you want to customize with Qty then you must change in following files:
  1.       app\design\adminhtml\default\default\template\catalog\product\edit\options\type\select.phtml

·         Find the below code:
'<th class="type-sku"><?php echo Mage::helper('catalog')->__('SKU') ?></th>'+
Add these after just after
'<th class="type-qty"><?php echo Mage::helper('catalog')->__('Qty') ?></th>'+
·         Find the below code:
'<td><input type="text" class="input-text" name="product[options][{{id}}][values][{{select_id}}][sku]" value="{{sku}}"></td>'+
Add these after just after
'<td><input type="text" class="input-text" name="product[options][{{id}}][values][{{select_id}}][qty]" value="{{qty}}"></td>'+

  2.       app\code\core\Mage\Adminhtml\Block\Catalog\Product\Edit\Tab\Options\Option.php

·         Find the below code:

$value['sku'] = $this->htmlEscape($option->getSku());
Add these code  just after

$value['qty'] = $this->htmlEscape($option->getQty());

·         Find the below code:

'sku' => $this->htmlEscape($_value->getSku()),

Add these code  just after

'qty' => $this->htmlEscape($_value->getQty()),

   3.       Add field in “catalog_product_option_type_value” table

`qty` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Qty',

That’s all….

Monday, 22 April 2013

Add Custom link in my account page Magento

Add Additionla link in Customer Page

1. app/design/frontend/default/theam/layout/customer.xml

2. Add below code in    <customer_account translate="label"> handle left part

<action method="addLink" translate="label" module="customer"><name>test</name><path>customer/test/</path><label>My Test</label></action>

3. add below code in xml file

<customer_test_index translate="label">
    <label>Customer My Test</label>
     <update handle="customer_account"/>

4. craete controller and block file in below location


add code in block file
class Mage_Customer_Block_Test extends Mage_Core_Block_Template
    public function __construct()

add code in testcontroller
class Mage_Customer_TestController extends Mage_Core_Controller_Front_Action
    public function indexAction()
5. create file test.phtml in app/design/frontent/theme/customer/test.phtml

add code in file
<div class="page-title">
    <h1><?php echo $this->__('My Ships'); ?></h1>   

Now login from frontend and you show the test link add in your account page

Saturday, 6 April 2013

Add Discount Label on List page

Open app/design/frontend/yourpackage/yourtheme/template/catalog/product/price.phtml


<?php endif; /* if ($_finalPrice == $_price): */ ?>

add Just after this line

<?php // Discount percents output start ?>
    <?php if($_finalPrice < $_price): ?>
    <?php $_savePercent = 100 - round(($_finalPrice / $_price)*100); ?>
        <p class="special-price yousave">
            <span class="label"><?php echo $this->__('You Save:') ?></span>
            <span class="price">
                <?php echo $_savePercent; ?>%
    <?php endif; ?>
<?php // Discount percent output end ?>

Create Home Page with CategroyProducts and Breadcums

<reference name="breadcrumbs">
        <action method="addCrumb">
            <crumbInfo> <label>Home</label>  <title>Home</title>  <link>/</link>   </crumbInfo>
<reference name="left">
<block type="catalog/layer_view"  name="catalog.leftnav" after="home_left" template="catalog/layer/view.phtml"/>

 <action method="unsetChild"><alias>left.newsletter</alias></action>
<action method="unsetChild"><alias>left.permanent.callout</alias></action>
<reference name="content">
<block type="catalog/product_list" name="home" template="catalog/product/list.phtml">
<action method="setCategoryId"><category_id>2</category_id></action>

<action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
<block type="page/html_pager" name="product_list_toolbar_pager"/>
<action method="setToolbarBlockName"><name>product_list_toolbar</name><count>5</count></action>

Friday, 5 April 2013

Extension for Vertical Navigation

Add shop by Block on Home Page

Add in Layout Updates

<reference name="left"> <block type="catalog/layer_view" before="-" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/> </reference>
go to  app/code/core/Mage/Catalog/Model/Layer/Filter and open item.php
and replace your getUrl() function to the following one
public function getUrl() { if ($this->getFilter() instanceof Mage_Catalog_Model_Layer_Filter_Category) { $category = Mage::getModel('catalog/category')->load($this->getValue()); return $category->getUrl(); } else { $query = array( $this->getFilter()->getRequestVar()=>$this->getValue(),Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls ); return Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true, '_query'=>$query)); } }