where is Payment Method part of Magento invoice coming from - magento

I modified this once before, but I have forgotten where this part of magento invoice comes from.!
\app\design\frontend\default\MYTHEME\somewhere?

The email template for a new Invoice is located at app/locale/en_US/template/email/invoice_new.html around line 64. I believe the Payment Method content is generated in the following file: app/design/frontend/base/default/template/payment/info/default.phtml.

Related

How to change magento shipment email template payment Method block

I am using magneto 1.9. How to i have change magento shipment email template payment Method block?
If you want to render a specific text/html for a particular payment method in shipment email template only then you have to override sendEmail function of Mage_Sales_Model_Order_Shipment class and play with $paymentBlockHtml variable.
In that function, you can add a condition like
if($order->getPayment()->getMethod()=='cashondelivery'){
$paymentBlockHtml = Mage::helper('sales')->__('Payment after delivery');
}
Hope it helps!
I have found found solution for payment block.
For change payment block need following below steps:
Step 1. Copy app\design\frontend\base\default\template\paygate\info\cc.phtml to app\design\frontend[Your Package][Your Theme]\template\paygate\info\cc.phtml
Step 2. Change here that you want to change
Step 3- Save

Magento placing order before paypal payment

i've a problem with paypal integration in magento.
If i choose paypal standard payment and confirm order, i'm correctly redirect to paypal site for payment, but if i press back button on the browser i am redirected in /checkout/cart (that is empty) and in my backend my order was placed and in PENDING status (it's not shown in customers order list)...
This happens because the order were placed before payment processing...
In OnepageController.php saveOrderAction method i can see
$this->getOnepage()->getQuote()->save();
/**
* when there is redirect to third party, we don't want to save order yet.
* we will save the order in return action.
*/
if (isset($redirectUrl)) {
$result['redirect'] = $redirectUrl;
}
What does it mean? It is exactly what i want "Don't want to save order yet....", unfortunatly few rows before...
$this->getOnepage()->saveOrder();
$redirectUrl = $this->getOnepage()->getCheckout()->getRedirectUrl();
And the order were already placed....
I hate editing core file, but i've tried to comment the line above, but an exception shows me that order information are used inside paypal module itself (Standard.php file method getStandardCheckoutFormFields). So i can't modify core file easily....
What am I missing?
Thanks a lot and excuse me for my bad english.
You can use for this purpose PayPal express checkout. It works the way you want.
I'm dealing with exactly same problem as you were.
For now i'm thinking of rewriting onePage Model and saveOrder action in my module.
What Im thinking of is to remove part where session is cleared and make an event to observer after receive payment method response.
No idea if it'll work but well.

Get Customer ID in Magento mail template

I'm trying to display the customer ID in the emails that Magento send when a logged in customer places a new order.
I read that the next line should work, but it doesn't: {{var customer.ID}}.
I read a lot of forums but I can't find the answer. Any help is very much appreciated!
I got it working (with thanks to Nadir!) withn the following example:
<h1>Hallo {{htmlescape var=$order.getCustomerName()}} (klant-ID: {{var customer.ID}}),</h1>
The customer object is not injected in the new order email template.
You can instead get the customer id from the order variable:
{{var order.getCustomerId()}}

How do I get the estimate shipping zipcode in Magento?

I am writing a custom shipping rates module, and I can’t seem to figure out how to get the estimate shipping zipcode… I know how to get the zipcode once the order has been created, but not for the estimate shipping portion of the checkout process
Any input is greatly appreciated!
Jeff
Whole information about the customer's cart is kept in Mage_Sales_Model_Quote model until placing an order. So you can get the Shipping Address model from the Quote. And from Shipping Address model you can get the zip code, which is called a 'post code' there. Thus, the only thing you initially need is to get Quote for the customer.
The Quote can be got in different ways:
loaded from DB by its id or by any other attribute
received from the Checkout session
received from the Checkout Cart model
The most general way is to get Quote by loading it from DB - this can be done in all the Magento workflows and areas (API, frontend, backend, etc.).
But for your case the most straightforward way is to get Quote from Checkout Cart model, as you don't need to know Quote id for it - at frontend Magento loads Cart with appropriate customer data automatically.
/** #var $cart Mage_Checkout_Model_Cart */
$cart = Mage::getSingleton('checkout/cart');
$quote = $cart->getQuote();
$shippingAddress = $quote->getShippingAddress();
$zip = $shippingAddress->getPostcode();
To get a little more understanding, why the Checkout Cart is used in this approach: the Checkout module manages the whole checkout process at frontend. It processes composing cart, viewing it, going through checkout steps and placing an order. Checkout module also stores the customer's quote model in its Cart model. While Quote stores whole information and can be used everywhere to manipulate customer's cart, the Cart model is just a temporary service model to aid Checkout module in fulfilling its duty, and it can be used at frontend for current customer.
you can do something like:
Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getPostcode();
//or
Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->getPostcode();

Magento; Modifying a payment module changing name in "method" field

Modifying a payment module I'm not having any success changing the "payment name" that is placed in table sales_flat_order_payment in field "method".
For example if payment is check, it is populated with checkmo.
I've tried changing
protected $_code = '.........'; in payment.php with no success.
I'm guessing this name may need changing in multiple places?
I have researched this but any answers I can find are assuming I have the skill level to know how to duplicate or modify the extension.
magento ver 1.4.1.1
more info; I'm using a Western Union payment extension as a Bpay payment extension and that field method is used to SMS payment type to me (and it would be more elegant it said what it really was!)
It's better to have a separate payment method for this. You can duplicate some existing method, and use your custom name.
Create a new payment module by duplicate one of your other payment module that closest matches what you are trying to do.
If you are trying to create a payment module for check then take a look at create a new payment method

Resources