2014-11-08 43 views
0

我想爲magento安裝2個插件:free-testimonial和MW_EasyTestimonial。 在安裝過程中我發現,使用相同名稱的兩個插件:Magento插件

文件app \代碼\社區\ Magebuzz \見證\等\ 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> 

文件app \代碼\ 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> 

如何安排2個插件的安裝?

回答

0

這需要進行很多代碼更改,並且最有可能的是,合併其中一個函數中缺少的任何函數,或者從另一個代碼中的代碼中合併。

你當然可以嘗試改變所有<testimonial><hm_testimonial>在第二XML,而且這也將需要更改每個PHP文件模塊使用相應getModel('hm_testimonial/model')Mage::helper('hm_testimonial')等大概在每一個地方,你見「證言」中提到在開始時加入「hm_」。

至少它看起來並不像是重寫任何核心類,這會讓它變得更加棘手。