Mage registry key “_singleton/ Observer” already exists - magento

Getting the error Mage registry key "_singleton/Mynamepsace_Dealers_Model_Observer" already exists when admin creates new order. In my config.xml I didn't find any error. I checked lot of posts regarding this issue, but did not trace the solution. Here is my config.xml -
<config>
<modules>
<Mynamespace_Dealers>
<version>1.4.0</version>
</Mynamespace_Dealers>
</modules>
<frontend>
<routers>
<dealers>
<use>standard</use>
<args>
<module>Mynamespace_Dealers</module>
<frontName>dealers</frontName>
</args>
</dealers>
</routers>
<layout>
<updates>
<dealers>
<file>dealers.xml</file>
</dealers>
</updates>
</layout>
</frontend>
<admin>
<routers>
<dealers>
<use>admin</use>
<args>
<module>Mynamespace_Dealers</module>
<frontName>dealers</frontName>
</args>
</dealers>
</routers>
</admin>
<adminhtml>
<events>
<sales_order_save_before>
<observers>
<dealers_order_save_before>
<class>Mynamepsace_Dealers_Model_Observer</class>
<method>orderSaveBefore</method>
</dealers_order_save_before>
</observers>
</sales_order_save_before>
</events>
<menu>
<dealers module="dealers">
<title>Dealers</title>
<sort_order>71</sort_order>
<children>
<items module="dealers">
<title>Manage Dealers</title>
<sort_order>0</sort_order>
<action>dealers/adminhtml_dealers</action>
</items>
</children>
</dealers>
</menu>
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<dealers translate="title" module="dealers">
<title>Dealers Section</title>
<sort_order>50</sort_order>
</dealers>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<dealers>
<file>dealers.xml</file>
</dealers>
</updates>
</layout>
</adminhtml>
<global>
<models>
<dealers>
<class>Mynamespace_Dealers_Model</class>
<resourceModel>dealers_mysql4</resourceModel>
</dealers>
<dealers_mysql4>
<class>Mynamespace_Dealers_Model_Mysql4</class>
<entities>
<order><table>sales_order</table></order>
</entities>
</dealers_mysql4>
</models>
<resources>
<dealers_setup>
<setup>
<module>Mynamespace_Dealers</module>
<class>Mage_Sales_Model_Mysql4_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</dealers_setup>
<dealers_write>
<connection>
<use>core_write</use>
</connection>
</dealers_write>
<dealers_read>
<connection>
<use>core_read</use>
</connection>
</dealers_read>
</resources>
<blocks>
<dealers>
<class>Mynamespace_Dealers_Block</class>
</dealers>
</blocks>
<helpers>
<dealers>
<class>Mynamespace_Dealers_Helper</class>
</dealers>
</helpers>
</global>
</config>
and here is my observer class-
<?php
class Mynamepsace_Dealers_Model_Observer
{
public function orderSaveBefore()
{
echo "I am here"; exit;
$order = $observer->getEvent()->getOrder();
}
}

Replace this code :
<events>
<sales_order_save_before>
<observers>
<dealers_order_save_before>
<class>Mynamepsace_Dealers_Model_Observer</class>
<method>orderSaveBefore</method>
</dealers_order_save_before>
</observers>
</sales_order_save_before>
</events>
with
<events>
<sales_order_save_before>
<observers>
<dealers_order_save_before>
<type>singleton</type>
<class>Mynamepsace_Dealers_Model_Observer</class>
<method>orderSaveBefore</method>
</dealers_order_save_before>
</observers>
</sales_order_save_before>
</events>
in config.xml
Note that <dealers_order_save_before> this should be unique. Check that you have used this anywhere in the other module in the same application.
Cheers :-)

Related

Magento 404 page in coming in admin panel for custom module

I have created a custom module in admin panel. I ma getting 404 page. My module is active , but I am getting 404 page.
My config.xml file:
<?xml version="1.0"?>
<config>
<modules>
<Blazedream_VendorComplaints>
<version>0.1.0</version>
</Blazedream_VendorComplaints>
</modules>
<frontend>
<routers>
<vendorcomplaints>
<use>standard</use>
<args>
<module>Blazedream_VendorComplaints</module>
<frontName>vendorcomplaints</frontName>
</args>
</vendorcomplaints>
</routers>
<layout>
<updates>
<vendorcomplaints>
<file>vendorcomplaints.xml</file>
</vendorcomplaints>
</updates>
</layout>
</frontend>
<global>
<helpers>
<vendorcomplaints>
<class>Blazedream_VendorComplaints_Helper</class>
</vendorcomplaints>
</helpers>
<blocks>
<vendorcomplaints>
<class>Blazedream_VendorComplaints_Block</class>
</vendorcomplaints>
</blocks>
<models>
<vendorcomplaints>
<class>Blazedream_VendorComplaints_Model</class>
<resourceModel>vendorcomplaints_mysql4</resourceModel>
</vendorcomplaints>
<vendorcomplaints_mysql4>
<class>Blazedream_VendorComplaints_Model_Mysql4</class>
<entities>
<complaints>
<table>vendor_complaints</table>
</complaints>
</entities>
</vendorcomplaints_mysql4>
</models>
<resources>
<vendorcomplaints_setup>
<setup>
<module>Blazedream_VendorComplaints</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</vendorcomplaints_setup>
<vendorcomplaints_write>
<connection>
<use>core_write</use>
</connection>
</vendorcomplaints_write>
<vendorcomplaints_read>
<connection>
<use>core_read</use>
</connection>
</vendorcomplaints_read>
</resources>
</global>
<admin>
<routers>
<vendorcomplaints>
<use>admin</use>
<args>
<module>Blazedream_VendorComplaints</module>
<frontName>vendorcomplaints</frontName>
</args>
</vendorcomplaints>
</routers>
</admin>
<adminhtml>
<menu>
<marketplace>
<children>
<vendorcomplaints module="vendorcomplaints">
<title>Manage Complaints</title>
<sort_order>0</sort_order>
<action>admin_vendorcomplaints/adminhtml_complaints</action>
</vendorcomplaints>
</children>
</marketplace>
</menu>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<vendorcomplaints>
<title>Complaints Module</title>
<sort_order>200</sort_order>
</vendorcomplaints>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<vendorcomplaints>
<file>vendorcomplaints.xml</file>
</vendorcomplaints>
</updates>
</layout>
</adminhtml>
</config>
I dont know where i had done mistake. Can anyone help me to fix this.?
I am new to magento.
first you should learn custom module.
have a look on these blogs.create-configuration-for-your-magento-extension
custom_magento_system_configuration
According to your code you might miss the ACL implementation.

Magento Module Permissions

I have a modules for Magento, when I try to assign permissions for other users apart from Admin role to the module (check the checkbox) when I click save it unchecks the box. I have looked through other solutions but still wasn't able to solve it. Please kindly help.
<config>
<modules>
<D3_Newsladdressimport>
<version>0.2.0</version>
</D3_Newsladdressimport>
</modules>
<frontend>
<routers>
<newsladdressimport>
<use>standard</use>
<args>
<module>D3_Newsladdressimport</module>
<frontName>newsladdressimport</frontName>
</args>
</newsladdressimport>
</routers>
<layout>
<updates>
<newsladdressimport>
<file>newsladdressimport.xml</file>
</newsladdressimport>
</updates>
</layout>
</frontend>
<admin>
<routers>
<newsladdressimport>
<use>admin</use>
<args>
<module>D3_Newsladdressimport</module>
<frontName>newsladdressimport</frontName>
</args>
</newsladdressimport>
</routers>
</admin>
<adminhtml>
<menu>
<newsletter>
<children>
<newsladdressimport module="newsladdressimport">
<title>Newsletter Address Import</title>
<sort_order>71</sort_order>
<action>newsladdressimport/adminhtml_newsladdressimport</action>
</newsladdressimport>
</children>
</newsletter>
</menu>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<newsletter>
<children>
<D3_Newsladdressimport>
<title>Newsladdressimport Module</title>
<sort_order>10</sort_order>
</D3_Newsladdressimport>
</children>
</newsletter>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<newsladdressimport>
<file>newsladdressimport.xml</file>
</newsladdressimport>
</updates>
</layout>
<translate>
<modules>
<newsladdressimport>
<files>
<default>D3_Newsladdressimport.csv</default>
</files>
</newsladdressimport>
</modules>
</translate>
</adminhtml>
<global>
<models>
<newsladdressimport>
<class>D3_Newsladdressimport_Model</class>
<resourceModel>newsladdressimport_mysql4</resourceModel>
</newsladdressimport>
<newsladdressimport_mysql4>
<class>D3_Newsladdressimport_Model_Mysql4</class>
<entities>
<newsladdressimport>
<table>newsladdressimport</table>
</newsladdressimport>
</entities>
</newsladdressimport_mysql4>
</models>
<resources>
<newsladdressimport_setup>
<setup>
<module>D3_Newsladdressimport</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</newsladdressimport_setup>
<newsladdressimport_write>
<connection>
<use>core_write</use>
</connection>
</newsladdressimport_write>
<newsladdressimport_read>
<connection>
<use>core_read</use>
</connection>
</newsladdressimport_read>
</resources>
<blocks>
<newsladdressimport>
<class>D3_Newsladdressimport_Block</class>
</newsladdressimport>
</blocks>
<helpers>
<newsladdressimport>
<class>D3_Newsladdressimport_Helper</class>
</newsladdressimport>
</helpers>
</global>
</config>
Use following code for working access right.
<config>
<modules>
<D3_Newsladdressimport>
<version>0.2.0</version>
</D3_Newsladdressimport>
</modules>
<frontend>
<routers>
<newsladdressimport>
<use>standard</use>
<args>
<module>D3_Newsladdressimport</module>
<frontName>newsladdressimport</frontName>
</args>
</newsladdressimport>
</routers>
<layout>
<updates>
<newsladdressimport>
<file>newsladdressimport.xml</file>
</newsladdressimport>
</updates>
</layout>
</frontend>
<admin>
<routers>
<newsladdressimport>
<use>admin</use>
<args>
<module>D3_Newsladdressimport</module>
<frontName>newsladdressimport</frontName>
</args>
</newsladdressimport>
</routers>
</admin>
<adminhtml>
<menu>
<newsletter>
<children>
<newsladdressimport module="newsladdressimport">
<title>Newsletter Address Import</title>
<sort_order>71</sort_order>
<action>newsladdressimport/adminhtml_newsladdressimport</action>
</newsladdressimport>
</children>
</newsletter>
</menu>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<newsletter>
<children>
<newsladdressimport>
<title>Newsletter Address Import</title>
<sort_order>71</sort_order>
</newsladdressimport>
</children>
</newsletter>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<newsladdressimport>
<file>newsladdressimport.xml</file>
</newsladdressimport>
</updates>
</layout>
<translate>
<modules>
<newsladdressimport>
<files>
<default>D3_Newsladdressimport.csv</default>
</files>
</newsladdressimport>
</modules>
</translate>
</adminhtml>
<global>
<models>
<newsladdressimport>
<class>D3_Newsladdressimport_Model</class>
<resourceModel>newsladdressimport_mysql4</resourceModel>
</newsladdressimport>
<newsladdressimport_mysql4>
<class>D3_Newsladdressimport_Model_Mysql4</class>
<entities>
<newsladdressimport>
<table>newsladdressimport</table>
</newsladdressimport>
</entities>
</newsladdressimport_mysql4>
</models>
<resources>
<newsladdressimport_setup>
<setup>
<module>D3_Newsladdressimport</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</newsladdressimport_setup>
<newsladdressimport_write>
<connection>
<use>core_write</use>
</connection>
</newsladdressimport_write>
<newsladdressimport_read>
<connection>
<use>core_read</use>
</connection>
</newsladdressimport_read>
</resources>
<blocks>
<newsladdressimport>
<class>D3_Newsladdressimport_Block</class>
</newsladdressimport>
</blocks>
<helpers>
<newsladdressimport>
<class>D3_Newsladdressimport_Helper</class>
</newsladdressimport>
</helpers>
</global>
</config>
In your code you have made following mistake.
You have to give same name identifier in menu as well as in acl.
<menu>
<newsletter>
<children>
<newsladdressimport module="newsladdressimport">
<title>Newsletter Address Import</title>
<sort_order>71</sort_order>
<action>newsladdressimport/adminhtml_newsladdressimport</action>
</newsladdressimport>
</children>
</newsletter>
</menu>
here you have given name <newsladdressimport module="newsladdressimport">
and in ACL you have given <D3_Newsladdressimport>
Hope it helps :)

adminhtml tag in config.xml file does not work

I am new to magento and making a custom module and want to work on admin end but after installing extension I get this error:
Fatal error: Class 'Submitdigital_CustomLogo_Helper_Data' not found in /var/zpanel/hostdata/zadmin/public_html/unisport_com/app/Mage.php on line 547
After insatalling extension when I clear cashe it give me this error. After somestudy I found that the error is due to this file at path:
app/code/local/Submitdigital/CustomLogo/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Submitdigital_CustomLogo>
<version>0.1.0</version>
</Submitdigital_CustomLogo>
</modules>
<global>
<helpers>
<customlogo>
<class>Submitdigital_CustomLogo_Helper</class>
</customlogo>
</helpers>
<blocks>
<customlogo>
<class>Submitdigital_CustomLogo_Block</class>
</customlogo>
</blocks>
<models>
<customlogo>
<class>Submitdigital_CustomLogo_Model</class>
<resourceModel>customlogo_mysql4</resourceModel>
</customlogo>
<customlogo_mysql4>
<class>Submitdigital_CustomLogo_Model_Mysql4</class>
<entities>
<customlogo>
<table>customlogo</table>
</customlogo>
</entities>
</customlogo_mysql4>
</models>
<resources>
<customlogo_setup>
<setup>
<module>Submitdigital_CustomLogo</module>
<class>Mage_Eav_Model_Entity_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</customlogo_setup>
<customlogo_write>
<connection>
<use>core_write</use>
</connection>
</customlogo_write>
<customlogo_read>
<connection>
<use>core_read</use>
</connection>
</customlogo_read>
</resources>
</global>
<admin>
<routers>
<admin_customlogo>
<use>admin</use>
<args>
<module>Submitdigital_CustomLogo</module>
<frontName>admin_customlogo</frontName>
</args>
</admin_customlogo>
</routers>
</admin>
<adminhtml>
<menu>
<customlogo module="customlogo">
<title>SubmitDigital</title>
<sort_order>100</sort_order>
<children>
<customlogo module="customlogo">
<title>Manage Customlogo</title>
<sort_order>0</sort_order>
<action>customlogo/adminhtml_customlogo</action>
</customlogo>
</children>
</customlogo>
</menu>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<customlogo translate="title" module="customlogo">
<title>SubmitDigital</title>
<sort_order>1000</sort_order>
<children>
<customlogo translate="title">
<title>Manage Customlogo</title>
<sort_order>0</sort_order>
</customlogo>
</children>
</customlogo>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<customlogo>
<file>customlogo.xml</file>
</customlogo>
</updates>
</layout>
</adminhtml>
<frontend>
<routers>
<customlogo>
<use>standard</use>
<args>
<module>Submitdigital_CustomLogo</module>
<frontName>customlogo</frontName>
</args>
</customlogo>
</routers>
<layout>
<updates>
<customlogo>
<file>customlogo.xml</file>
</customlogo>
</updates>
</layout>
</frontend>
</config>
all goes well with the file but when I add <adminhtml>...</adminhtml> in the file it gives the above error and hence I am not able to see anything at my admin end.
Please Help
here is my customlogo.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<customlogo_adminhtml_customlogo_index>
<reference name="content">
<block type="customlogo/adminhtml_customlogo" name="customlogo" />
</reference>
</customlogo_adminhtml_customlogo_index>
</layout>
You have to create the helper class to fix this issue.
app/code/local/Submitdigital/CustomLogo/Helper/Data.php
class Submitdigital_CustomLogo_Helper_Data extends Mage_Core_Helper_Abstract
{
}
You have the following code to call the helper
<customlogo module="customlogo">
Here
module parameter is used to call the helper for translation.

Magento plugins

I am trying to install 2 plugins for magento: free-testimonial and MW_EasyTestimonial.
During installation I found that 2 plugins using the same names:
file app\code\community\Magebuzz\Testimonial\etc\config.xml:
<default>
<testimonial>
<general_option>
<show_link_testimonial>1</show_link_testimonial>
<enable_sidebar>1</enable_sidebar>
<enable_testimonial_paging>1</enable_testimonial_paging>
<divide_page>9, 15, 30, 'all'</divide_page>
<max_testimonials_sidebar>3</max_testimonials_sidebar>
<testimonial_sidebar_slider>0</testimonial_sidebar_slider>
</general_option>
<testimonial_options>
<testimonial_captcha_enabled>1</testimonial_captcha_enabled>
<allow_customers_write_testimonial >1</allow_customers_write_testimonial >
<allow_guest_write_testimonial>0</allow_guest_write_testimonial>
<approve_testimonial>1</approve_testimonial>
<thank_message><![CDATA[Your testimonial was successfully posted and waiting for approval.]]></thank_message>
</testimonial_options>
<email_configuration>
<send_email_after_post_testimonial>0</send_email_after_post_testimonial>
<send_email_after_approve_testimonial>0</send_email_after_approve_testimonial>
<select_template_post>testimonial_email_configuration_select_template_post</select_template_post>
<select_template_approve>testimonial_email_configuration_select_template_approve</select_template_approve>
</email_configuration>
</testimonial>
</default>
<modules>
<Magebuzz_Testimonial>
<version>0.1.4</version>
</Magebuzz_Testimonial>
</modules>
<frontend>
<routers>
<testimonial>
<use>standard</use>
<args>
<module>Magebuzz_Testimonial</module>
<frontName>testimonial</frontName>
</args>
</testimonial>
</routers>
<layout>
<updates>
<testimonial>
<file>testimonial.xml</file>
</testimonial>
</updates>
</layout>
</frontend>
<admin>
<routers>
<testimonial>
<use>admin</use>
<args>
<module>Magebuzz_Testimonial</module>
<frontName>testimonial</frontName>
</args>
</testimonial>
</routers>
</admin>
<adminhtml>
<layout>
<updates>
<testimonial>
<file>testimonial.xml</file>
</testimonial>
</updates>
</layout>
</adminhtml>
<global>
<models>
<testimonial>
<class>Magebuzz_Testimonial_Model</class>
<resourceModel>testimonial_mysql4</resourceModel>
</testimonial>
<testimonial_mysql4>
<class>Magebuzz_Testimonial_Model_Mysql4</class>
<entities>
<testimonial>
<table>simple_testimonial</table>
</testimonial>
</entities>
</testimonial_mysql4>
</models>
<resources>
<testimonial_setup>
<setup>
<module>Magebuzz_Testimonial</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</testimonial_setup>
<testimonial_write>
<connection>
<use>core_write</use>
</connection>
</testimonial_write>
<testimonial_read>
<connection>
<use>core_read</use>
</connection>
</testimonial_read>
</resources>
<blocks>
<testimonial>
<class>Magebuzz_Testimonial_Block</class>
</testimonial>
</blocks>
<helpers>
<testimonial>
<class>Magebuzz_Testimonial_Helper</class>
</testimonial>
</helpers>
<template>
<email>
<testimonial_email_configuration_select_template_post translate="label" module="testimonial">
<label>Custom Email Template After Post Testimonial</label>
<file>email_template_after_post_testimonial.html</file>
<type>html</type>
</testimonial_email_configuration_select_template_post >
<testimonial_email_configuration_select_template_approve translate="label" module="testimonial">
<label>Custom Email Template After Approve Testimonial</label>
<file>email_template_after_approve_testimonial.html</file>
<type>html</type>
</testimonial_email_configuration_select_template_approve >
</email>
</template>
</global>
file app\code\local\Hm\Testimonial\etc\config.xml:
<modules>
<Hm_Testimonial>
<version>2.2.3</version>
</Hm_Testimonial>
</modules>
<frontend>
<secure_url>
<testimonial>/testimonial/</testimonial>
</secure_url>
<routers>
<testimonial>
<use>standard</use>
<args>
<module>Hm_Testimonial</module>
<frontName>testimonial</frontName>
</args>
</testimonial>
</routers>
<layout>
<updates>
<testimonial>
<file>testimonial.xml</file>
</testimonial>
</updates>
</layout>
<translate>
<modules>
<Hm_Testimonial>
<files>
<default>Hm_Testimonial.csv</default>
</files>
</Hm_Testimonial>
</modules>
</translate>
</frontend>
<admin>
<routers>
<testimonial>
<use>admin</use>
<args>
<module>Hm_Testimonial</module>
<frontName>testimonial</frontName>
</args>
</testimonial>
</routers>
</admin>
<adminhtml>
<translate>
<modules>
<Hm_Testimonial>
<files>
<default>Hm_Testimonial.csv</default>
</files>
</Hm_Testimonial>
</modules>
</translate>
<menu>
<testimonial module="testimonial">
<title>Testimonials</title>
<sort_order>71</sort_order>
<children>
<items module="testimonial">
<title>Manage Testimonials</title>
<sort_order>0</sort_order>
<action>testimonial/adminhtml_testimonial</action>
</items>
<configurations module="testimonial">
<title>Configuration</title>
<sort_order>1</sort_order>
<action>adminhtml/system_config/edit/section/hm_testimonial</action>
</configurations>
</children>
</testimonial>
</menu>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<Hm_Testimonial>
<title>Testimonial Module</title>
<sort_order>10</sort_order>
<items module="testimonial" translate="title">
<title>Manage Product</title>
<sort_order>0</sort_order>
</items>
<configurations module="testimonial" translate="title">
<title>Configurations</title>
<sort_order>30</sort_order>
</configurations>
</Hm_Testimonial>
<system>
<children>
<config>
<children>
<hm_testimonial>
<title>Hello Magento Testimonial</title>
</hm_testimonial>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<testimonial>
<file>testimonial.xml</file>
</testimonial>
</updates>
</layout>
</adminhtml>
<global>
<models>
<testimonial>
<class>Hm_Testimonial_Model</class>
<resourceModel>testimonial_mysql4</resourceModel>
</testimonial>
<testimonial_mysql4>
<class>Hm_Testimonial_Model_Mysql4</class>
<entities>
<testimonial>
<table>testimonial</table>
</testimonial>
<testimonial_store>
<table>testimonial_store</table>
</testimonial_store>
</entities>
</testimonial_mysql4>
</models>
<resources>
<testimonial_setup>
<setup>
<module>Hm_Testimonial</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</testimonial_setup>
<testimonial_write>
<connection>
<use>core_write</use>
</connection>
</testimonial_write>
<testimonial_read>
<connection>
<use>core_read</use>
</connection>
</testimonial_read>
</resources>
<blocks>
<testimonial>
<class>Hm_Testimonial_Block</class>
</testimonial>
</blocks>
<helpers>
<testimonial>
<class>Hm_Testimonial_Helper</class>
</testimonial>
</helpers>
<template>
<email>
<testimonial_email_email_template translate="label" module="contacts">
<label>Testimonial Email</label>
<file>testimonial_email.html</file>
<type>text</type>
</testimonial_email_email_template>
</email>
</template>
<events>
<controller_front_init_before>
<observers>
<testimonial>
<type>singleton</type>
<class>Hm_Testimonial_Model_Observer</class>
<method>checkLicense</method>
</testimonial>
</observers>
</controller_front_init_before>
</events>
</global>
<default>
<hm_testimonial>
<general>
<enable>0</enable>
<maxword>30</maxword>
<delay>4000</delay>
<width>160</width>
<height>160</height>
<slider>fadeZoom</slider>
<heightslide>400</heightslide>
<allow_media>1</allow_media>
<allow_media_popup>1</allow_media_popup>
<total>5</total>
<maxfilesize>0</maxfilesize>
</general>
<email>
<template_email>testimonial_email_email_template</template_email>
</email>
</hm_testimonial>
</default>
How can I arrange installation of 2 plugins?
It's gonna take quite a few code changes, and most probably it would be easier to merge in any function missing from one of them, from the code in the other one.
You could of course try to change all the <testimonial> to <hm_testimonial> in the second XML, but that would also require that you change each PHP file in that module to use the corresponding getModel('hm_testimonial/model'), Mage::helper('hm_testimonial') and so on in probably every place you see "testimonial" mentioned adding "hm_" to the start.
At least it doesn't look like they are overriding any core classes, that would have made it much trickier.

Magento - plugin overwrite local.xml block

I have a local.xml file that has the following:
<default>
<cms_index_index translate="label">
<reference name="masthead">
<block type="page/html" template="cms/masthead/homepage.phtml" as="banners" />
</reference>
</cms_index_index translate="label">
</default>
I have a plugin that has it's own config.xml - I wish to override the above block with a template located in: /app/code/local/MageWorx/GeoIP/cms/homepage.phtml.
The config.xml file is however different and looks like:
<config>
<modules>
<MageWorx_GeoIP>
<version>1.0.7</version>
</MageWorx_GeoIP>
</modules>
<frontend>
<translate>
<modules>
<MageWorx_GeoIP>
<files>
<default>MageWorx_GeoIP.csv</default>
</files>
</MageWorx_GeoIP>
</modules>
</translate>
<routers>
<geoip>
<use>standard</use>
<args>
<module>MageWorx_GeoIP</module>
<frontName>geoip</frontName>
</args>
</geoip>
</routers>
<layout>
<updates>
<geoip>
<file>geoip.xml</file>
</geoip>
</updates>
</layout>
<events>
<controller_action_predispatch>
<observers>
<geoip>
<type>singleton</type>
<class>MageWorx_GeoIP_Model_Observer</class>
<method>geoipAutoswitcher</method>
</geoip>
</observers>
</controller_action_predispatch>
<controller_action_predispatch_directory_currency_switch>
<observers>
<geoip>
<type>singleton</type>
<class>MageWorx_GeoIP_Model_Observer</class>
<method>setCurrency</method>
</geoip>
</observers>
</controller_action_predispatch_directory_currency_switch>
</events>
</frontend>
<global>
<models>
<geoip>
<class>MageWorx_GeoIP_Model</class>
<resourceModel>geoip_mysql4</resourceModel>
</geoip>
<geoip_mysql4>
<class>MageWorx_GeoIP_Model_Mysql4</class>
</geoip_mysql4>
<core>
<rewrite>
<store>MageWorx_GeoIP_Model_Core_Store</store>
</rewrite>
</core>
</models>
<resources>
<geoip_setup>
<setup>
<module>MageWorx_GeoIP</module>
<class>MageWorx_GeoIP_Model_Mysql4_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</geoip_setup>
<geoip_write>
<connection>
<use>core_write</use>
</connection>
</geoip_write>
<geoip_read>
<connection>
<use>core_read</use>
</connection>
</geoip_read>
</resources>
<blocks>
<geoip>
<class>MageWorx_GeoIP_Block</class>
</geoip>
<adminhtml>
<rewrite>
<sales_order_view_info>MageWorx_Adminhtml_Block_Geoip_Adminhtml_Sales_Order_View_Info</sales_order_view_info>
<customer_online_grid>MageWorx_Adminhtml_Block_Geoip_Adminhtml_Customer_Online_Grid</customer_online_grid>
<system_store_edit_form>MageWorx_Adminhtml_Block_Geoip_Adminhtml_System_Store_Edit_Form</system_store_edit_form>
</rewrite>
</adminhtml>
<checkout>
<rewrite>
<onepage_billing>MageWorx_GeoIP_Block_Checkout_Onepage_Billing</onepage_billing>
<onepage_shipping>MageWorx_GeoIP_Block_Checkout_Onepage_Shipping</onepage_shipping>
</rewrite>
</checkout>
<customer>
<rewrite>
<address_edit>MageWorx_GeoIP_Block_Customer_Address_Edit</address_edit>
</rewrite>
</customer>
</blocks>
<helpers>
<geoip>
<class>MageWorx_GeoIP_Helper</class>
</geoip>
</helpers>
</global>
<adminhtml>
<acl>
<resources>
<all><title>Allow Everything</title></all>
<admin>
<children>
<system>
<children>
<config>
<children>
<mageworx_customers translate="title" module="mageworx">
<title>MageWorx > Customers</title>
<sort_order>1</sort_order>
<children>
<geoip translate="title" module="geoip">
<title>GeoIP Location</title>
</geoip>
</children>
</mageworx_customers>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<geoip>
<file>geoip.xml</file>
</geoip>
</updates>
</layout>
</adminhtml>
<default>
<mageworx_customers>
<geoip>
<enable_store_switcher>1</enable_store_switcher>
<enable_currency_switcher>1</enable_currency_switcher>
<force_store_view>1</force_store_view>
<store_switcher_scope>1</store_switcher_scope>
<disable_store_switcher_key>off</disable_store_switcher_key>
<store_switcher_exception_urls>/paypal/*</store_switcher_exception_urls>
<db_type>1</db_type>
<db_path>lib/GeoIP/GeoIP.dat</db_path>
<enable_billing_country>1</enable_billing_country>
<enable_shipping_country>1</enable_shipping_country>
<enable_address_country>1</enable_address_country>
</geoip>
</mageworx_customers>
</default>
Does anyone know where and what I should add in that config.xml to override the local.xml block?
you can not override any of your block or action with local.xml to config.xml
here is magento truth is
config.xml and local.xml are loaded together, along with any other xml file you place in app/local. They are loaded in Mage_Core_Model_Config::loadBase()
public function loadBase()
{
$etcDir = $this->getOptions()->getEtcDir();
$files = glob($etcDir.DS.'*.xml');
$this->loadFile(current($files));
while ($file = next($files)) {
$merge = clone $this->_prototype;
$merge->loadFile($file);
$this->extend($merge);
}
if (in_array($etcDir.DS.'local.xml', $files)) {
$this->_isLocalConfigLoaded = true;
}
return $this;
}
And if your want to understand more about local.xml, see this.
hope you can understand more clearly now.

Resources