Anulación de un método de envío: ¿qué me estoy perdiendo?
He escrito muchos módulos antes, pero por alguna razón mi módulo de envío no anulará un método de envío existente de Magneto. eso está permitido? ¿Que me estoy perdiendo aqui? El nombre del módulo aparece en la pestaña avanzada del área de configuración, por lo que se está cargando, pero no sucede nada. ¿Alguna pista?
Código
etc / modules / Ssi_Shipping.xml
<?xml version="1.0"?>
<config>
<modules>
<Ssi_Shipping>
<active>true</active>
<codepool>local</codepool>
</Ssi_Shipping>
</modules>
</config>
local / Ssi / envío / 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>
local / Ssi / Shipping / Model / Carrier / 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;
}
}