나는 단순히 활성화 된 경우 내 자신의 템플릿 파일과 파일 shipping.phtml/원래 카트를 오버라이드 (override) 할 것을 확장 구축을 위해 노력하고 작동하지 해제 활성화하면 확장 기능을 사용할 수 없습니다. 수동으로 내 레이아웃 블록 테마를 변경하면 확장 프로그램이 실제로 작동 함을 알 수 있습니다. 그러나, 나는 그것을하고 싶지 않다. 제 코드를 살펴보고 제가 잘못하고있는 것을 알려주시겠습니까? 나는 그것이 내 블록 파일과 관련이 있다고 가정하고있다. 추신 무엇이 잘못되었고 어떻게 수정해야하는지 알 수 있다면 확장 기능을 사용하는 경우 CSS 파일을 설정하는 방법을 알려줄 수 있습니까?사용자 정의 젠토 확장</p> <p>내가 클릭하면 .. 사용하고
여기에 내 모든 파일 :
등/config.xml에
<?xml version="1.0"?>
<config>
<modules>
<Module_Name><version>1.0.0</version></Module_Name>
</modules>
<global>
<blocks>
<modulename>
<class>Module_Name_Block</class>
</modulename>
</blocks>
<helpers>
<modulename>
<class>Module_Name_Helper</class>
</modulename>
</helpers>
</global>
<modulename>
<settings>
<enable>1</enable>
</settings>
</modulename>
<frontend>
<layout>
<updates>
<modulename>
<file><!-- shipping.xml --></file>
</modulename>
</updates>
</layout>
<routers>
<modulename>
<use>standard</use>
<args>
<module>Module_Name</module>
<frontName>modulename</frontName>
</args>
</modulename>
</routers>
</frontend>
<adminhtml>
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<modulename>
<title>Shipping Extension</title>
</modulename>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</adminhtml>
</config>
등/system.xml을
<?xml version="1.0"?>
<config>
<tabs>
<module translate="label">
<label>Custom Extensions</label>
<sort_order>100</sort_order>
</module>
</tabs>
<sections>
<modulename translate="label">
<label>Shipping</label>
<tab>module</tab>
<frontend_type>text</frontend_type>
<sort_order>1000</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<groups>
<settings translate="label">
<label>Settings</label>
<frontend_type>text</frontend_type>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<enable translate="label">
<label>Enable</label>
<comment>
<![CDATA[Enable or Disable this extension.]]>
</comment>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</enable>
</fields>
</settings>
</groups>
</modulename >
</sections>
</config>
도우미/Data.php
<?php
class Module_Name_Helper_Data extends Mage_Core_Helper_Abstract
{
}
있습니다
블록/장바구니/Shipping.php
<?php
class Module_Name_Block_Cart_Shipping extends Mage_Checkout_Block_Cart_Shipping
{
protected function _beforeToHtml()
{
if(Mage::getStoreConfig('modulename/settings/enable'))
$this->setTemplate('module/name/shipping.phtml');
return $this;
}
}
감사합니다. @benmarks! 그래서 내가 만든 배송 블록을 제거하고 이것을 etc/config.xml 파일이나 etc/config.xml 파일에서 주석 처리 한 것과 같은 template layout.xml 파일에 추가해야합니까? –
당신은 남자입니다 !! 정말 고맙습니다! ifconfig = "dropdownshipping/settings/enable"을 추가하여 레이아웃을 제어 할 수 있는지 몰랐습니다. 너 락! 정말 고마워!! –