How to change magento shipment email template payment Method block - magento

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

Related

Magento one-page checkout showing no payment method

Am creating a module to add an additional payment system to Magento after creating the module. It is appearing in the admin panel and I have enabled it, but it is showing no payment method.
So payment methods are shown on the checkout page after they pass the function Mage_Checkout_Block_Onepage_Payment_Methods::_canUseMethod now this function basically checks if the method itself is setup and if it is valid against the current quote via two calls.
The payment methods own function canUseCheckout. Now since you are creating your own method I dont know what you function here looks like but I guess it would not be too complex to debug by yourself.
The payment forms Mage_Payment_Block_Form_Container::_canUseMethod. Now what this function does is check the payment method against the country, currency and quote total.
With the following
return $method->isApplicableToQuote($this->getQuote(), Mage_Payment_Model_Method_Abstract::CHECK_USE_FOR_COUNTRY
| Mage_Payment_Model_Method_Abstract::CHECK_USE_FOR_CURRENCY
| Mage_Payment_Model_Method_Abstract::CHECK_ORDER_TOTAL_MIN_MAX
);
Now if your payment method does not override anything here then it simply checks the config values of min_order_total, max_order_total, specificcountry and if you have any special currency checks.

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.

where is Payment Method part of Magento invoice coming from

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.

Magento variable to display payment method in email subject

I'm trying to display the payment method in the email subject for new order emails in Magento. The reason being is so that our client can easily determine from the subject of emails send from Magento whether the order came via the payment gateway or Paypal Express.
I'm not entirely sure of the best way to achieve this, I would like to think there is already something available I could use for this.
{{var payment_html}}
returns the payment method block for email templates...
{{var paymentMethod}}
returns absolutely nothing in the email subject so unsure whether this is a depreciated variable now.
I suppose there is also the option of creating a custom attribute, calling it in a static block and then displaying this as a custom variable in the email templates but it seems a rather long winded approach just to purely get a text string of "via SagePay" or "via Paypal Express".
Any help would be greatly appreciated.
Thanks in advance.
You actually don't need to perform any customization, this variable is already available in the template though the object chain. This chain is supported by Magento template and allows usage of getters of the object.
In this case you need to retrieve order's payment object, then retrieve its method instance and retrieve method title from method instance. It is very simple construction:
{{var order.getPayment().getMethodInstance().getTitle()}}
This should help you!
Method Mage_Sales_Model_Order::sendNewOrderEmail() is responsible for sending new ordr emails.
$paymentBlock = Mage::helper('payment')->getInfoBlock($this->getPayment())
->setIsSecureMode(true);
$paymentBlock->getMethod()->setStore($storeId);
$paymentBlockHtml = $paymentBlock->toHtml();
...
$mailer->setTemplateParams(array(
'order' => $this,
'billing' => $this->getBillingAddress(),
'payment_html' => $paymentBlockHtml
)
payment_html is rendered html output of the block, so you can not use it.
You can add one more assoc key (using rewite or local/mage trick) with the payment method and add this param to the subject using transactional emails.

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