Hello, I'm trying to accomplish this: I've been working with the site.php file for my other customizations, and I wonder if I can accomplish this, by doing the same approach, then what hook should I listen to? I also still got no clue about updating the Invoice Item price. I'd be grateful if anyone can point me out with a working code. Thank you
You can use event Am_Event::INVOICE_GET_CALCULATORS to add your calculator. Also you will need to implement calculator based on Am_Invoice_Calc class. To get idea how it works please check file amember/library/Am/Invoice/Calc.php
Thank you for still paying attention to this thread, caesar. What I want to implement is to handle offline payment method for my customers; Adjust the invoice.first_total based on my function, which will return a new calculated first_total price Apply the calculated price on Am_Event::INVOICE_BEFORE_INSERT But I still got no clue to work on your suggested Am_Invoice_Calc class. That's why I need more code snippet from you ------------------ OOT ------------------ I know my next question is out-of-topic, but is it possible to create two offline payment method options on Signup Form? I want to allow my customer to choose one out of two bank account.
You can use this code in site.php (http://www.amember.com/docs/Site.php_file) HTML: Am_Di::getInstance()->hook->add(Am_Event::INVOICE_BEFORE_PAYMENT_SIGNUP, 'myHandler'); function myHandler(Am_Event $e) { /* @var $invoice Invoice */ $invoice = $e->getInvoice(); $invoice->updateQuick('first_total', 30); } Regarding second offline plugin. Yes, it is possible. Please copy file amember/application/default/plugins/payment/offline.php to amember/application/default/plugins/payment/offline2.php and inside file offline2.php replace Am_Paysystem_Offline with Am_Paysystem_Offline2