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

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

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

問題描述

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

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;

        }


    }

推薦答案

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

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.

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

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

相關(guān)文檔推薦

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 設(shè)置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數(shù)組自動填充選擇框)
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 產(chǎn)生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 四虎黄色片| 久久久久久久久久一区二区三区 | 精品免费在线 | 日本三级在线视频 | 三上悠亚激情av一区二区三区 | 一区二区三区四区精品 | 久久久久久久久久国产 | 国产成人精品一区二区三区视频 | 天天干天天弄 | 日本亚洲天堂 | 国产黄色片视频 | 国产成人精品亚洲男人的天堂 | av激情小说 | 久久99深爱久久99精品 | 欧美日韩在线播放 | 日韩在线免费 | 国产aⅴ爽av久久久久成人 | 国产浮力第一页 | 黄免费网站 | 午夜aaa| 影音先锋在线观看视频 | 在线播放日韩 | 日本一级大毛片a一 | 国产极品国产极品 | 欧美a级成人淫片免费看 | 欧美久久一区二区 | 可以免费看的av | 日韩一级大片 | 逼逼操 | 久久久久免费 | 天天摸夜夜操 | 曰本毛茸茸性生活 | 一级黄视频 | 在线免费观看av网站 | аⅴ资源新版在线天堂 | 中文字幕日韩视频 | 久久成人毛片 | 日日操夜夜 | 五月婷婷六月激情 | 中文字幕一区在线 | 黄色大片免费在线观看 |