이전에 많은 모듈을 작성했지만 어떤 이유로 배송 모듈이 기존의 Magneto 배송 방법보다 우선 적용되지 않습니다. 그게 허용됩니까? 내가 여기서 무엇을 놓치고 있니? 모듈 이름은 구성 영역의 고급 탭에 나타나므로로드되고 있지만 아무 것도 일어나지 않습니다. 어떤 힌트?배송 방법 무시 - 무엇이 누락 되었습니까?
코드
등/모듈/Ssi_Shipping.xml
<?xml version="1.0"?>
<config>
<modules>
<Ssi_Shipping>
<active>true</active>
<codepool>local</codepool>
</Ssi_Shipping>
</modules>
</config>
지역/SSI/배송/etc.xml
<?xml version="1.0"?>
<config>
<modules>
<Ssi_Shipping>
<version>0.1.0</version>
</Ssi_Shipping>
</modules>
<global>
<models>
<shipping>
<rewrite>
<carrier_tablerate>Ssi_Shipping_Model_Carrier_Tablerate</carrier_tablerate>
</rewrite>
</shipping>
</models>
</global>
</config>
지역/SSI/배송/모델/캐리어/Tablerate .php
<?php
class Ssi_Shipping_Model_Carrier_Tablerate
extends Mage_Shipping_Model_Carrier_Tablerate {
public function isActive()
{
Mage::log("here! Ssi_Shipping_Model_Carrier_Tablerate");
// check to see if it's disabled
if (parent::isActive() == false)
return false;
// check in the shopping cart
foreach(Mage::getSingleton('checkout/session')->getQuote()->getItemsCollection() as $item){
if ($item->getDeliveryFlag() == "test")
return true;
}
// if nothing is found then disable this option.
return false;
}
}
강력하게 추천하지 않습니다. 이동 통신사를 무시할 수있는 확실한 방법이 있습니다. 제 답변을 참조하십시오. –