Wednesday, March 2, 2016

Add Module Link in Customer Account Dashboard Magento2

           <!---------------------------- Create Simple module --------------------------------->

          1. App/Code/Custom/Module/registration.php

                  <?php
                             \Magento\Framework\Component\ComponentRegistrar::register(
                                          \Magento\Framework\Component\ComponentRegistrar::MODULE,
                                               'Custom_Module',
                                                     __DIR__
                                           );
                   ?>


         2. App/code/Custom/Module/etc/module.xml
                   <?xml version="1.0"?>
       <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
                 <module name="Custom_Module" setup_version="1.0.0">
                    <sequence>
                          <module name="Magento_Customer"/>
                      </sequence>
                 </module>
        </config>


       3. app/code/Custom/Module/view/frontend/layout/customer_account.xml
             
            <?xml version="1.0"?>
            <body>
              <referenceContainer name="customer_account_navigation">
            
                <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-account-link-custom"> 
                    <arguments>
                        <argument name="label" xsi:type="string" translate="true">Custom Title</argument>
                        <argument name="path" xsi:type="string">module/controller/action</argument>
                    </arguments>
                </block>
          
           </referenceContainer>
         </body>

Sunday, April 7, 2013

Store credit card save off in magento

Hii Every body i am going to show you how you can avoid store credit card detail in magento

Here are two steps only


1:  file url : /app/code/core/Mage/Payment/Block/Info/Ccsave.php


   // Replace that function in your existing function of that file.....

   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') => ''));
        $transport = parent::_prepareSpecificInformation($transport);
        if (!$this->getIsSecureMode()) {
            $transport->addData(array(
                Mage::helper('payment')->__('Expiration Date') => '',
                Mage::helper('payment')->__('Credit Card Number') => '',
            ));
        }
        return $transport;
    }
 2: file url : app/code/core/Mage/Payment/Block/Info/Cc.php


   // on that file repace existing function with this

      protected function _prepareSpecificInformation($transport = null)
    {
        if (null !== $this->_paymentSpecificInformation) {
            return $this->_paymentSpecificInformation;
        }
        $transport = parent::_prepareSpecificInformation($transport);
        $data = array();
        if ($ccType = $this->getCcTypeName()) {
            $data[Mage::helper('payment')->__('Credit Card Type')] = NULL;//$ccType;
        }
        if ($this->getInfo()->getCcLast4()) {
            $data[Mage::helper('payment')->__('Credit Card Number')] = NULL;//sprintf('xxxx-%s', $this->getInfo()->getCcLast4());
        }
        if (!$this->getIsSecureMode()) {
            if ($ccSsIssue = $this->getInfo()->getCcSsIssue()) {
                $data[Mage::helper('payment')->__('Switch/Solo/Maestro Issue Number')] =NULL;// $ccSsIssue;
            }
            $year = $this->getInfo()->getCcSsStartYear();
            $month = $this->getInfo()->getCcSsStartMonth();
            if ($year && $month) {
                $data[Mage::helper('payment')->__('Switch/Solo/Maestro Start Date')] = NULL;// $this->_formatCardDate($year, $month);
            }
        }       
        return $transport->setData(array_merge($data, $transport->getData()));
    }


 I hope this will help you to solve your problem . Thanks all