0

I need to create a module garage in customer like addresses where I can add new garage. Could you give me some ideas? thanks For the moment, this is what I have enter image description here

this is my code bellow

PMC/Garagetab/Block/Adminhtml/Garage/Tab.php

<?php
class PMC_Garagetab_Block_Adminhtml_Garage_Tab
extends Mage_Adminhtml_Block_Template
implements Mage_Adminhtml_Block_Widget_Tab_Interface {
   /**
     * Set the template for the block
     *
     */
    public function _construct()
    {
        parent::_construct();
       $this->setTemplate('garagetab/tab.phtml');
    }
   /**
     * Retrieve the label used for the tab relating to this block
     *
     * @return string
     */
    public function getTabLabel()
    {
        return $this->__('Mes Garages');
    }
   /**
     * Retrieve the title used by this tab
     *
     * @return string
     */
    public function getTabTitle()
    {
        return $this->__('Click here to view your garages tab content');
    }
   /**
     * Determines whether to display the tab
     * Add logic here to decide whether you want the tab to display
     *
     * @return bool
     */
    public function canShowTab()
    {
        return true;
    }
    /**
     * Stops the tab being hidden
     *
     * @return bool
     */
    public function isHidden()
    {
        return false;
    }
}

file config.xml

<config>
   <modules>
       <PMC_Garagetab>
           <version>0.1.0</version>
       </PMC_Garagetab>
   </modules>
   <adminhtml>
        <layout>
           <updates>
               <garagetab>
                  <file>garagetab.xml</file>
               </garagetab>
           </updates>
       </layout>
   </adminhtml>  
   <global>
       <blocks>
           <garagetab>
               <class>PMC_Garagetab_Block</class>
           </garagetab>
       </blocks>
 </global>
</config>

file design/adminhtml/default/default/template/garagetab/tab.phtml

<div id="garage_info_tabs_garage_edit_tab_action_content">
    <div class="entry-edit">
        <div class="entry-edit-head">
            <h4 class="icon-head head-edit-form fieldset-legend">Action Tab</h4>
        </div>
        <div id="group_fields4" class="fieldset fieldset-wide">
            <div class="hor-scroll">
                <table class="form-list" cellspacing="0">
                    <tbody>
                        <tr>
                        <td>Garage Custom Action Tab Contents Here</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
 </div>
2
  • Take a look at class Mage_Adminhtml_Block_Customer_Edit_Tab_Addresses in core folder. You will need to duplicate something similar for your Garage. Jun 13, 2015 at 13:47
  • hi @lloiacono, thanks for your comment. I have already seen this file, it is very long. I need a simple exemple CRUD to save,delete,update my fields in the database Jun 16, 2015 at 19:13

1 Answer 1

0

I'm searching for a Magento 2 garage addon too, something where i can store VIN numbers, car details like color, model etc. connected to the client info in magento 2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.