久久久久久久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)
主站蜘蛛池模板: 91社影院在线观看 | 玖玖视频网 | 男人的天堂亚洲 | 亚洲成在线观看 | 中文字幕乱码亚洲精品一区 | 欧美在线一区二区三区 | 国产高清免费视频 | 久久精品黄色 | 亚洲欧美日韩精品久久亚洲区 | 欧美一区二区三区在线观看 | 成人av资源在线 | 久久伊人免费视频 | 国产精品毛片一区二区在线看 | 国产小视频精品 | 国产成人综合一区二区三区 | 国产伦精品 | 日韩在线精品视频 | 正在播放国产精品 | 欧美午夜精品 | 黄色毛片在线观看 | 国产精品久久 | 福利av在线| 中文字幕国产第一页 | 电影91久久久 | 久久久婷 | 久久这里只有精品首页 | 日韩中文一区二区三区 | 精品免费 | 福利国产 | 欧美亚洲激情 | 玖玖视频免费 | 久久久精品影院 | 91在线观看网址 | 91人人澡人人爽 | www.伊人.com | 国产亚洲一区二区三区在线 | 精品中文在线 | 一区二区三区四区视频 | 午夜视频在线播放 | 久久伊人一区二区 | 亚洲精品乱码久久久久久按摩观 |