मैंने पहले कई मॉड्यूल लिखे हैं लेकिन किसी कारण से मेरा शिपिंग मॉड्यूल एक एक्सटिटिंग मैग्नेटो शिपिंग विधि को ओवरराइड नहीं करेगा। क्या यह अनुमति है? मुझे यहां क्या समझ नहीं आ रहा है? मॉड्यूल नाम कॉन्फ़िगरेशन क्षेत्र के उन्नत टैब में दिखाई देता है, इसलिए यह लोड हो रहा है, लेकिन कुछ भी नहीं हो रहा है। कोई संकेत?एक शिपिंग विधि को ओवरराइड करना - मुझे क्या याद आ रहा है
कोड
आदि/मॉड्यूल/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;
}
}
मैं दृढ़ता से इसकी अनुशंसा नहीं करता हूं। वाहक को ओवरराइड करने का एक साफ तरीका है, मेरा जवाब देखें। –