久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

覆蓋運輸方式 - 我錯過了什么

Overridding a Shipping Method - What am I missing(覆蓋運輸方式 - 我錯過了什么)
本文介紹了覆蓋運輸方式 - 我錯過了什么的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我以前寫過很多模塊,但由于某種原因,我的運輸模塊不會覆蓋現有的萬磁王運輸方式.允許嗎?我在這里錯過了什么?模塊名稱顯示在配置區域的高級選項卡中,因此它正在加載,但什么也沒有發生.任何提示?

I've written many many modules before but for some reason my shipping module won't override an exsiting Magneto shipping method. Is that allowed? What am I missing here? The module name shows up in the advanced tab of the configuration area, so it's getting loaded, but nothing is happening. Any hints?

代碼

etc/modules/Ssi_Shipping.xml

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/Shipping/etc.xml

local/Ssi/Shipping/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

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;

        }


    }

推薦答案

在仔細研究這個之后,我發現覆蓋傳送控制器的唯一方法是在本地代碼文件夾.然后我基本上可以調整代碼.

After working through this one a bit, I found that the only way to override the shipping controller was to make a duplicate of the file (and directory structure) in the local code folder. Then I could basically tweak the code.

不知道為什么 Magento 似乎不允許標準覆蓋這些傳送功能,但至少有一個解決方法.

Not sure why Magento doesn't seem to allow the standard overriding of these shipping functions, but a least there is a work around.

這篇關于覆蓋運輸方式 - 我錯過了什么的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數組自動填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 免费在线一区二区 | 台湾佬伊人 | 国产精品国产成人国产三级 | 国产日韩av一区二区 | 国产在线观看一区二区 | 亚洲国产精品网站 | 91精品国产91久久久久久最新 | 国产精品日韩欧美一区二区三区 | 亚洲一区二区三区视频在线 | 黄免费在线| 激情欧美日韩一区二区 | 免费在线看黄视频 | 亚洲一区 | 欧美一级黑人aaaaaaa做受 | 国产成人精品免费 | 91热在线 | av毛片免费 | 一级特黄在线 | 中文字幕第三页 | av网站免费看 | 成人a在线观看 | 亚洲性在线 | 久久国产精品一区 | 3级毛片 | 国产精品欧美大片 | 99精品免费久久久久久日本 | 免费观看一级毛片 | 久草中文在线观看 | 国产一区二区 | 欧美日韩国产高清 | 看黄在线 | 精品免费国产一区二区三区 | 久久久高清 | 中文字幕在线免费视频 | 亚洲国产一区二区三区四区 | 国产精品视频在线观看 | 国产精品呻吟久久av凹凸 | 天堂网中文字幕在线观看 | 国产中文字幕av | 九一国产精品 | 国产目拍亚洲精品99久久精品 |