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

Magento - 如何在結帳過程中向訂單添加發票費用

Magento - How do I add an invoice fee to an order during checkout process(Magento - 如何在結帳過程中向訂單添加發票費用)
本文介紹了Magento - 如何在結帳過程中向訂單添加發票費用的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

如何使用我的付款模塊向訂單添加發票費用?我想這應該在結賬過程中通過我的付款方式模型完成.也許我應該創建一個項目/產品并將其添加到購物車/報價單/訂單對象?

How do I add an invoice fee to an order with my payment module? I guess this should be done during the checkout process through my payment method model. Perhaps I should create and add an item/product to the cart/quote/order object?

我不知道如何做這些事情.請幫忙

I don't know how to do any of these things though. Please help

推薦答案

雖然它可能不適合虛偽的人.以下是向總計區域添加一條線的粗略步驟,然后將您的費用添加到總計中.

Although possible it is not for the feint-hearted. Here is a rough run-down of the steps to add a line to the totals area, which will then add your fee to the grand total.

在配置節點 添加一個新條目(參見 app/code/core/Mage/Sales/etc/config.xml 更多例子)

In the config node <global><sales><quote><total> add a new entry (see app/code/core/Mage/Sales/etc/config.xml for more examples)

<paymentFee>
    <class>yourmodule/quote_address_total_paymentFee</class> <!-- A model -->
    <after>subtotal</after>
</paymentFee>

還在 config.xml 中添加以下內容到 ...

Also in the config.xml add the following to <global>...

<fieldsets>
    <sales_convert_quote>
        <payment_fee><to_order>*</to_order></payment_fee>
    </sales_convert_quote>
</fieldsets>

創建模型來計算費用.

class Your_Module_Model_Quote_Address_Total_Warranty extends Mage_Sales_Model_Quote_Address_Total_Abstract
{
    public function __construct()
    {
        $this->setCode('paymentFee');
    }

    public function collect(Mage_Sales_Model_Quote_Address $address)
    {
        // Check the payment method in use, if it is yours do...
        $address->setPaymentFee($fee);
        return $this;
    }

    public function fetch(Mage_Sales_Model_Quote_Address $address)
    {
        if ($address->getPaymentFee()) {
            $address->addTotal(array(
                'code'  => $this->getCode(),
                'title' => 'Your module payment message',
                'value' => $address->getPaymentFee()
            ));
        }
        return $this;
    }
}

在您的模塊設置中,將 sales_flat_quotesales_flat_order 表修改為 添加payment_fee 列.

In your module's setup, modify the sales_flat_quote and sales_flat_order tables to add a payment_fee column.

config 中的 值負責確定計算順序,可以是逗號分隔的總計代碼列表,包括tax"、discount"等. 出于相同的目的,您也可以指定 值.fetch() 方法中的 $address->addTotal 將完成更新總計的工作,這是向客戶收取的費用.有必要更改報價和訂單表,以便記錄您收取的費用并向管理員顯示.

The <after> value in the config is responsible for determining the order of calculation, it can be a comma-separated list of totals' codes including "tax", "discount", etc. You may also specify a <before> value for the same purposes. The $address->addTotal in fetch() method will do the work of updating the grand total, which is what the customer will be charged. It is necessary to alter the quote and order tables so the fee you have charged is recorded and shown to the admin.

如果默認渲染器不行,也可以指定自己的渲染器,我也這樣做過,但更復雜.

It is also possible to specify your own renderer if the default will not do, I have done this also but is even more complex.

這篇關于Magento - 如何在結帳過程中向訂單添加發票費用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)
主站蜘蛛池模板: 欧美在线视频一区二区 | 精产国产伦理一二三区 | 黄网站免费在线 | 日韩视频一区 | 色综合久久88色综合天天 | 国产成人综合在线 | 国产精品视频一二三区 | 中文字幕一区二区在线观看 | 亚洲成av人片在线观看 | 日韩欧美电影在线 | 一区二区三区精品在线视频 | 欧美日韩手机在线观看 | 日韩在线中文 | 免费观看www | 亚洲精品国产偷自在线观看 | 久久精品一 | 国内自拍真实伦在线观看 | 一区二区三区精品视频 | 欧美日韩综合精品 | 国产伊人久久久 | 中文字幕一区二区三区四区五区 | 日韩免费网站 | 免费能直接在线观看黄的视频 | 国产电影一区 | 欧美日韩一 | 日韩日韩日韩日韩日韩日韩日韩 | 国产女人与拘做受免费视频 | 视频在线一区二区 | 欧美视频偷拍 | 日韩在线视频一区 | 日本视频中文字幕 | 国产日韩欧美在线观看 | 亚洲高清一区二区三区 | 人人做人人澡人人爽欧美 | 精品亚洲一区二区 | 欧美在线亚洲 | 久久久久久免费毛片精品 | 亚洲精品自在在线观看 | 一区二区三区免费看 | 欧美福利视频一区 | 久久国产一区二区三区 |