Featured post
php - Magento - How do I add an invoice fee to an order during checkout process -
how add invoice fee order payment module? guess should done during checkout process through payment method model. perhaps should create , add item/product cart/quote/order object?
i don't know how of these things though. please help
although possible not feint-hearted. here rough run-down of steps add line totals area, add fee grand total.
in config node <global><sales><quote><total>
add new entry (see app/code/core/mage/sales/etc/config.xml
more examples)
<paymentfee> <class>yourmodule/quote_address_total_paymentfee</class> <!-- model --> <after>subtotal</after> </paymentfee>
also in config.xml
add following <global>
...
<fieldsets> <sales_convert_quote> <payment_fee><to_order>*</to_order></payment_fee> </sales_convert_quote> </fieldsets>
create model calculate fee.
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 payment method in use, if 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; } }
in module's setup, modify sales_flat_quote
, sales_flat_order
tables add payment_fee column.
the <after>
value in config responsible determining order of calculation, can comma-separated list of totals' codes including "tax", "discount", etc. may specify <before>
value same purposes. $address->addtotal
in fetch()
method work of updating grand total, customer charged. necessary alter quote , order tables fee have charged recorded , shown admin.
it possible specify own renderer if default not do, have done more complex.
- Get link
- X
- Other Apps
Comments
Post a Comment