编辑模块似乎无效

时间:2017-03-29 14:55:04

标签: magento debugging caching plugins magento-1.9

我使用的是一个根据物品重量计算运输方式的模块。该模块似乎已安装,但如果我对主类进行编辑,则前端似乎没有任何反映。

主类扩展了Mage_Shipping_Model_Carrier_Abstract,见下文:

<?php  
class Laurensmedia_Advancedshipping_Model_Carrier_Advancedshipping     
extends Mage_Shipping_Model_Carrier_Abstract
implements Mage_Shipping_Model_Carrier_Interface
{   

    protected $_code = 'advancedshipping';  

config.xml文件如下所示:

<?xml version="1.0"?>
<config>
  <modules>
    <Laurensmedia_Advancedshipping>
      <version>0.1.0</version>
    </Laurensmedia_Advancedshipping>
  </modules>
  <global>
    <helpers>
      <advancedshipping>
        <class>Laurensmedia_Advancedshipping_Helper</class>
      </advancedshipping>
    </helpers>
    <blocks>
      <advancedshipping>
        <class>Laurensmedia_Advancedshipping_Block</class>
      </advancedshipping>
    </blocks>
    <models>
      <advancedshipping>
        <class>Laurensmedia_Advancedshipping_Model</class>
        <resourceModel>advancedshipping_mysql4</resourceModel>
      </advancedshipping>
      <advancedshipping_mysql4>
        <class>Laurensmedia_Advancedshipping_Model_Mysql4</class>
        <entities>        
              <matrix>
                <table>advancedshipping_matrix</table>
              </matrix>
        </entities>
      </advancedshipping_mysql4>
            <shipping>
                <rewrite>
                    <shipping>Laurensmedia_Advancedshipping_Model_Shipping_Shipping</shipping>
                </rewrite>
            </shipping>
    </models>
    <resources>
      <advancedshipping_setup>
        <setup>
          <module>Laurensmedia_Advancedshipping</module>
        </setup>
        <connection>
          <use>core_setup</use>
        </connection>
      </advancedshipping_setup>
      <advancedshipping_write>
        <connection>
          <use>core_write</use>
        </connection>
      </advancedshipping_write>
      <advancedshipping_read>
        <connection>
          <use>core_read</use>
        </connection>
      </advancedshipping_read>
    </resources>
  </global>
  <admin>
    <routers>
      <advancedshipping>
        <use>admin</use>
        <args>
          <module>Laurensmedia_Advancedshipping</module>
          <frontName>advancedshipping</frontName>
        </args>
      </advancedshipping>
    </routers>
  </admin>
  <adminhtml>
    <menu>
      <advancedshipping module="advancedshipping">
        <title>Advancedshipping</title>
        <sort_order>100</sort_order>
        <children>
          <matrix module="advancedshipping">
            <title>Manage Matrix</title>
            <sort_order>0</sort_order>
            <action>advancedshipping/adminhtml_matrix</action>
          </matrix>
          <import module="advancedshipping">
            <title>Import from CSV</title>
            <sort_order>1</sort_order>
            <action>advancedshipping/adminhtml_matrix/import</action>
          </import>
          <settings>
            <title>Manage Settings</title>
            <sort_order>999</sort_order>
            <action>adminhtml/system_config/edit/section/lm_advancedshipping</action>
          </settings>
        </children>
      </advancedshipping>
    </menu>
    <acl>
      <resources>
        <all>
          <title>Allow Everything</title>
        </all>
        <admin>
          <children>
            <advancedshipping translate="title" module="advancedshipping">
              <title>Advancedshipping</title>
              <sort_order>1000</sort_order>
              <children>
                  <matrix translate="title">
                    <title>Manage Matrix</title>
                    <sort_order>0</sort_order>
                  </matrix>
                  <import translate="title">
                    <title>Import from CSV</title>
                    <sort_order>1</sort_order>
                  </import>
                  <settings translate="title">
                    <title>Manage Settings</title>
                    <sort_order>999</sort_order>
                  </settings>
              </children>
            </advancedshipping>
          </children>
        </admin>
      </resources>
    </acl>
    <layout>
      <updates>
        <advancedshipping>
          <file>advancedshipping.xml</file>
        </advancedshipping>
      </updates>
    </layout>
  </adminhtml>    
    <default>
        <carriers>
            <advancedshipping>
                <active>1</active>
                <model>advancedshipping/carrier_advancedshipping</model>
                <name>Advanced Shipping</name>
                <title>Laurensmedia</title>
                <description>Laurensmedia Advanced Shipping description</description>
                <sort_order>0</sort_order>
            </advancedshipping>
        </carriers>
    </default>
</config>

我尝试了以下内容:

  • 清除Magneto缓存
  • 手动删除/ var / cache /
  • 的内容
  • 将所有其他模块复制到../disabled/(实际上       禁用它们)

上述情况似乎都没有奏效。任何人都可以提供任何建议,为什么当我编辑主类文件没有任何反应?即使我故意破坏文件(即 - 删除一半代码),我甚至看不到任何错误。

1 个答案:

答案 0 :(得分:1)

我没有在配置中看到为<rewrite>声明Laurensmedia_Advancedshipping_Model_Carrier_Advancedshipping

这可以解释为什么它没有被拾取,因为它似乎想要重写标准的Magento类。

如果它不打算作为重写,该类是如何被调用的?