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

Magento - 如何在結(jié)帳過程中向訂單添加發(fā)票費(fèi)用

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

問題描述

如何使用我的付款模塊向訂單添加發(fā)票費(fèi)用?我想這應(yīng)該在結(jié)賬過程中通過我的付款方式模型完成.也許我應(yīng)該創(chuàng)建一個項目/產(chǎn)品并將其添加到購物車/報價單/訂單對象?

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

推薦答案

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

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.

在配置節(jié)點(diǎn) 添加一個新條目(參見 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 中添加以下內(nèi)容到 ...

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>

創(chuàng)建模型來計算費(fèi)用.

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;
    }
}

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

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.

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

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.

這篇關(guān)于Magento - 如何在結(jié)帳過程中向訂單添加發(fā)票費(fèi)用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)
主站蜘蛛池模板: 国产亚洲一区二区三区 | 久久久久免费精品国产小说色大师 | 超碰免费在线 | 91精品国产91综合久久蜜臀 | 巨大荫蒂视频欧美另类大 | 日韩高清不卡 | 国产精品久久久久久久7电影 | 97伊人| 欧美日韩成人网 | 天天草天天 | 亚洲国产精品人人爽夜夜爽 | 国内自拍偷拍一区 | 伊人网综合 | 粉嫩av久久一区二区三区 | 国产激情福利 | 国产美女黄色片 | 欧美精品一区二区三区在线播放 | 欧美黄 片免费观看 | 亚洲一区二区三区在线免费观看 | 青青久久av北条麻妃海外网 | 国产一区二区三区在线免费观看 | 波多野结衣先锋影音 | 国产人成精品一区二区三 | 久久久久黄 | 色综合视频 | 超碰天天| 天天躁日日躁xxxxaaaa | 狠狠狠色丁香婷婷综合久久五月 | 99热热 | 久久精品 | 午夜理伦三级理论三级在线观看 | 日本午夜免费福利视频 | 91大片 | 亚洲国产欧美在线 | 成人免费视频网站在线观看 | 天天干亚洲 | 国产日产精品一区二区三区四区 | 三级av网址 | 国产精品久久av | 一区二区视频在线 | 在线视频成人 |