Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

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.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -