Payment method sort order. Won't work - magento

I'm trying to change my payment method sort order but it won't work.
I have 2 payment method modules, and i need select the output order, already changed on config.xml of each module.
But don't change the order. I've try to change the call of phtml, to getChildHtml('payment',true,true); but neither work too.
I'm out of ideas, someone can help me??
Thanks guys.

Related

Magento Editng Mage_Adminhtml_Block_Report_Filter_Form

I need to add some more fields into the Sales order report filter (Mage_Adminhtml_Block_Report_Filter_Form) and also into the result grid below the form. I am unable to do so. Can anyone please help me to do this.
Thank You.
To solve this issue, What i am doing is overriding files that are needed for my task and doing. That way is easy to so so.

how to add cash on delivery charges by my custom module magento

HI I want to add some charges on cash on delivery, I dont know where to do that
what I need to extend or what observer I need to call and how I can get and update quote price can any body explain briefly to me.
Thanks in advance
Before you start thinking about code you need to describe (if only to yourself) how your new "cash on delivery" feature will work with Magento. When will users be prompted for this choice? What needs to be added to the backend order information panes? etc.
Once you know that, you can start to identify the blocks/phtml and model logic you'll need to change/add-to in order to implement your feature.

Magento Shipping Method problems

My problem is that i made ZIP Code optional, but now, if i write any number in the box, shipping methods are dissapearing .
i can write everything in the One Page Checkout, but when i get to zip code (which is optional now), and i write something, shipping methods dissaper and i try to finish order, i get
Your order cannot be completed at this time as there is no shipping
methods available for it. Please make necessary changes in your
shipping address.
If anyone knows how to solve this, thank you

Virtuemart Coupon Plugin based on quantity not value

I've had a look at available Virtuemart plugins and I can't find anything close to what I am after. This is what I need.
Allow admin user to create coupon codes. An import feature would be nice as there will be thousands but I can handle this bit if needed anyway.
The admin user selects the number of products the customer is allowed for each coupon code.
When the customer uses the coupon code they are allowed to choose any product on the website up to the total amount of products issued to the coupon. Regardless of the products price.
Nice extra would be to allow free shipping with the coupon.
I've looked at the possibility of extending virtuemart and I think it would be possible. It would however require quite a lot of changes and if I can find something that is halfway there it would help me on my way.
Thanks in advance.
OK well time was running out and I didn't get an answer so I rolled my own. It was actually fairly painless. I can't release the code but I can give you a good idea of the steps and a direction to go in.
extend vm_ps_coupon and override the update, add and process methods. Add and update should only require a change to the array that is sent to the DB. See here for more info on extending classes
Alter the enum in the database to allow for quantity as well as total and percent.
Within your new update method handle the variation of quantity to do as you need.
In the update method you can also set a flag for free shipping in a session variable.
In templates/checkout edit list_shipping_methods.php. Simply check for the free shipping flag and load the free_shipping class. You can then call free_shipping->list_rates($vars);
extend vm_ps_checkout, override the add method, call the parent add method and then check the result so you can delete the session variable for the free shipping.
Finally you will need to make some changes in the HTML. Unfortunatly i could not find a way to override this easily and since its only two small changes to the markup i just went ahead and hacked the core. If anyone knows of another way that would be great? I did see something online about using a Joomla hook and a System plugin but I'd rather keep it reliant on Virtuemart only.
In administrator/components/com_virtuemart/html/ edit coupon.coupon_form.php to show the new quantity radio button.
Then edit coupon.coupon_list.php to display the correct values. Currently it will only display percent and total.
Hope this helps someone in the future. If you need some assistance then post on here and I'll be happy to help.

How to get payment method in an observer in Magento?

I have an observer that handles the event: sales_payment_invoice_pay (or something like that).
What I'm trying to do is to send an invoice if the payment method is PayPal.
Everything is ok in version 1.4~ by doing $observer->getEvent()->getOrder()->getPayment->getMethodInstance().
In version 1.5+ however I can't seem to find any solutions.
I also tried with getData() but without any results.
Any help is appreciated. thanks
Calling me super desperate for an answer would be an understatement.
It looks like the only data passed in to the sales_order_invoice_pay event is $this, which will be the sales/order_invoice model. I found this by searching through the Magneto core code, it's fired off in Invoice.php like so:
Mage::dispatchEvent('sales_order_invoice_pay', array($this->_eventObject=>$this));
Looking at a similar event (sales_order_invoice_register) which has an observer in the core (of Enterprise, at least - increaseOrderGiftCardInvoicedAmount() in GiftCardAccount) you can access the Invoice object like this in your Observer method:
$invoice = $observer->getEvent()->getInvoice();
The invoice is all you will be able to get though, since it's the only thing passed to the Observers by dispatchEvent(). You cannot directly access the order, like you are trying to do.
Looking at the Invoice model, however, it appears to have a nice getOrder method, which should do the trick. I haven't tested it, but try this:
$observer->getEvent()->getInvoice()->getOrder()->getPayment->getMethodInstance();
Cheers and good luck!
i can get the payment method code using this
$observer->getEvent()->getInvoice()->getOrder()->getPayment()->getMethodInstance()->getCode()
user this code:$order->getPayment()->getMethodInstance()->getCode() ;

Resources