0

I'm stuck on an issue with displaying the payment method details in the email that is sent to client on new orders, this is using a custom payment method that I created. What I have so far is; I have created a module with a block at app/code/local/PayOnDelivery/Block and in it a Info.php file with the following content:

class PayOnDelivery_Block_Info extends Mage_Payment_Block_Info
{
    protected function _construct()
    {
        parent::_construct();
        $this->setTemplate('payondelivery/info.phtml');
    }
}

Secondly I have created a info.phtml in app/design/frontend/default/default/template/payondelivery.

I have also created Data.php at app/code/local/PayOnDelivery/Helper, the file is empty with just the class defininition in it (shouldn't need anything else).

class PayOnDelivery_Helper_Data extends Mage_Core_Helper_Abstract
{

}

Also I have the necessary PayOnDelivery.php in app/code/local/PayOnDelivery/Model, the file has the necessary functions for the info.phtml to use.

The content of the info.phtml get printed nicely on the page when printing the order confirmation and also on the order page when displaying the order afterwards. For some reason the same content does not get applied to the email that is sent as new order.

I'm using the default order_new.html template for emails but the {{var payment_html}} is ending up empty. Anyone got ideas of the cause? I'm using Magento 1.9...

  • anything in var/log? – Marius Nov 18 '14 at 7:50
  • Unfortunately nothing :( – user2166737 Nov 18 '14 at 16:01
  • I also got this issue when i created my own custom payment module for CC processing. Everything works fine but the new order email does not have any Payment info. Any advice please? – Altaf Hussain Jun 22 '16 at 8:42
-1

Just a guess: your theme is not default? If not try to place the template into base/default.

  • Wow this was the correct guess! :) I moved it over, works like a charm now :) – user2166737 Nov 18 '14 at 20:47
  • It did not worked for me. My new order email still does not show any payment information. – Altaf Hussain Jun 22 '16 at 8:41
0

its because orderId doesn't set in Params
@ default/template/payment/inf/banktransfer.phtml

after

$orderId = $this->getRequest()->getParam('order_id');

add:

if ($orderId==NULL) {
        $shipid = $this->getRequest()->getParam('shipment_id');
        $shipment = Mage::getModel('sales/order_shipment')->load($shipid)->getItemsCollection()->getItems();
    if($shipment!=NULL){
        foreach ($shipment as $value) {
            $dataOrder = $value->getShipment()->getData();
        }

        $orderId = $dataOrder['order_id'];
    }
}

its work for me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.