0

I don't want to display the credit card details on invoice PDF.

How can I achieve this programmatically? In which file should I do the modification?

Pleaseenter image description here check the attached image

1

You can do it by pluginize or Overwrite.

vendor/magento/module-authorizenet/Block/Adminhtml/Order/View/Info/PaymentDetails.php

Change the template and modify there which field you want to hide.

/**
 * Render as PDF
 * @return string
 */
public function toPdf()
{
    $this->setTemplate('Magento_Payment::info/pdf/default.phtml');
    return $this->toHtml();
}

This is not tested code.

0

I have found the answer of above question

Need to change the $payment variable output in below file:

app/code/core/mage/Sales/Model/Order/Pdf/Abstract.php

1) just debug the $payment variable and check the output... line # 434

2) then when you draw the output then check for the foreach output. line #530

you can exclude the details of credit card by modifying the code from above two sections mentioned lines

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.