2

How to solve below error

Fatal error: Uncaught Error: Class 'Mage_Companyname_Deliverydate_Block_Adminhtml_Mappingdate' not found in \app\code\core\Mage\Core\Model\Layout.php on line 590

below is my files

app/code/local/Companyname/Deliverydate/Block/Adminhtml

<?php

class Companyname_Deliverydate_Block_Adminhtml_Mappingdate  
    extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
{

    public function __construct()
    {
        $helper = Mage::helper('deliverydate');

        $this->addColumn('column_one', array(
            'style' => 'width:200px',
            'label' => $helper->__('Column One'),
        ));

        $this->addColumn('column_two', array(
            'style' => 'width:200px',
            'label' => $helper->__('Column Two'),
        ));

        $this->addColumn('column_three', array(
            'style' => 'width:80px',
            'label' => $helper->__('Column Three'),
        ));

        parent::__construct();
    }
}

Config.xml

<global>
 <blocks>
  <deliverydate>
     <class>Companyname_Deliverydate_Block</class>
  </deliverydate>
 </blocks>
  <helpers>
      <deliverydate>
            <class>Companyname_Deliverydate_Helper</class>
      </deliverydate>
   </helpers>
<default>
            <deliverydate>
                <deliverydate_general>
                    <enabled>0</enabled> 
                    <on_which_page>1</on_which_page>   
                    <deliverydate_format>d/M/Y</deliverydate_format>
                    <deliverytime_format>g:i a</deliverytime_format>
                    <deliverydate_dayoff></deliverydate_dayoff>
                    <mapping_date></mapping_date>
                </deliverydate_general>
            </deliverydate>
        </default>
</global>

system.xml

<config>
    <sections>
        <deliverydate translate="label" module="deliverydate">
            <class>separator-top</class>
            <label>Delivery Date</label>
            <tab>Companyname</tab>
            <sort_order>130</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <deliverydate_general translate="label">
                    <label>General</label>
                    <frontend_type>text</frontend_type>
                    <sort_order>10</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
      <mapping_date>
       <label>Date Off</label>                  <frontend_model>companyname_deliverydate/adminhtml_mappingdate</frontend_model>                          <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
                            <sort_order>10</sort_order>
                            <show_in_default>1</show_in_default>   <show_in_website>1</show_in_website>
                            <show_in_store>0</show_in_store>
                        </mapping_date>
                    </fields>
                </deliverydate_general>
            </groups>
        </deliverydate>
    </sections>
</config>
  • file is available at the path @rakesh – divya sekar Mar 9 at 6:39
  • check my answer – Rakesh Donga Mar 9 at 6:41
  • How looks your xml file where you overwrite the default block? – HelgeB Mar 9 at 6:44
  • For me it's still not clear how your block is called. You have no rewrite in your xml for the Magento default block, that would be the simplest way to use your block instead of Magento's. do you have a custom layout xml where you have put something? The layout definition does not route to your module. – HelgeB Mar 9 at 7:23
2

you can replace below line

<frontend_model>companyname_deliverydate/adminhtml_mappingdate</frontend_model>

to

<frontend_model>deliverydate/adminhtml_mappingdate</frontend_model>
  • please mention where going to change this line – divya sekar Mar 9 at 6:44
  • i tried for array serialized pls refer this @rakesh – divya sekar Mar 9 at 6:53
  • When I was used Mage it shows a same error @rakesh – divya sekar Mar 9 at 7:02
  • Can u please tell me what was the issue in that file @rakesh – divya sekar Mar 9 at 7:26
  • here issue in calling file problem – Rakesh Donga Mar 9 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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