0

I have added 2 new input fields in one of my payment methods in the template. Here's the code:

<input type="text" id="swiftcode" name="payment[debit_swift]" title="<?php echo $this->__('SWIFT Code') ?>" class="input-text" value="<?php echo $this->getAccountSwift() ?>" />

and

<input type="text" id="iban" name="payment[debit_iban]" title="<?php echo $this->__('IBAN') ?>" class="input-text" value="<?php echo $this->getAccountIban() ?>" />

I in the DB table sales_flat_order_payment the column name for the 2 attributes is debit_swift and debit_iban.

So, so when I tried to show the information in the order details in the back-end, I couldn't. I have added the text, but I do not get the information that has been saved in the order:

<?php echo $this->__('BIC (Swift-code): ', $this->htmlEscape($_info->getAccountSwift())) ?><br />
<?php echo $this->__('IBAN: ', $this->htmlEscape($_info->getAccountIban())) ?><br />

I use $_info->getAccount...() because for the other attributes (that are input fields in the front-end and are shown in the order details in the back-end) is used the same way of acquiring the information.

Any suggestions on that how to show the information in the back-end order details?

EDIT: this is the whole code of the template.

<?php if ($_info = $this->getMethod()): ?>
    <?php echo $this->htmlEscape($_info->getTitle()) ?><br /><br />

    <?php if ($this->isEmailContext()): ?>

        <?php if ($this->sendDataInEmail()): ?>
            <?php $_data = $this->getEmailData() ?>
            <?php if (!empty($_data['bank_name'])): ?>
                <?php echo $this->__('Bank name: %s', $this->htmlEscape($_data['bank_name'])) ?><br />
            <?php endif; ?>

            <?php echo $this->__('Bank code: %s', $this->htmlEscape($_data['account_blz'])) ?><br />
            <?php echo $this->__('Account holder: %s', $this->htmlEscape($_data['account_name'])) ?><br />
            <?php echo $this->__('Account number: %s', $this->htmlEscape($_data['account_number'])) ?><br />
            <?php echo $this->__('BIC (Swift-code): ', $this->htmlEscape($_data['swift'])) ?><br />
            <?php echo $this->__('IBAN: ', $this->htmlEscape($_data['iban'])) ?><br />
        <?php endif; ?>

    <?php else: ?>

        <?php if ($_info->getAccountBankname() == Mage::helper('debit')->__('not available')): ?>
            <span style="color: #cc0000;font-weight:bold;"><?php echo $this->__('Fehler! Die eingegebenen Bankdaten können fehlerhaft sein!<br />Bitte setzen Sie sich mit dem Kunden in Verbindung!') ?></span><br /><br />
        <?php else: ?>
            <?php echo $this->__('Bank name: %s', $this->htmlEscape($_info->getAccountBankname())) ?><br />
        <?php endif; ?>
        <?php echo $this->__('Account holder: %s', $this->htmlEscape($_info->getAccountName())) ?><br />
        <?php echo $this->__('Account number: %s', $this->htmlEscape($_info->getAccountNumber())) ?><br />
        <?php echo $this->__('Bank code: %s', $this->htmlEscape($_info->getAccountBLZ())) ?><br />
        <?php echo $this->__('Customer number: %s', $this->htmlEscape($_info->getInfoInstance()->getKundennummer())) ?><br />
        <?php echo $this->__('BIC (Swift-code): ', $this->htmlEscape($_info->getAccountSwift())) ?><br />
        <?php echo $this->__('IBAN: ', $this->htmlEscape($_info->getAccountIban())) ?><br />

        ?>
    <?php endif; ?>

    <br />
<?php endif; ?>

2 Answers 2

1

If you closely look your code it should be as follows.

<?php echo $this->__('BIC (Swift-code): ', $this->htmlEscape($_info->getAccountSwift())) ?><br />
<?php echo $this->__('IBAN: ', $this->htmlEscape($_info->getAccountIban())) ?><br />
4
  • Okay, I see that I have missed the t on getAccountIban(). But I still do not get any information displayed. Is there anything in Configuration tab that has to be set?
    – Syspect
    Commented Jan 23, 2014 at 10:33
  • Did you try to var_dump() the order object and check whether it contains the info which you are looking for?
    – Sukeshini
    Commented Jan 23, 2014 at 11:22
  • I am not using the order object in the template. I updated my question with the whole code from the template.
    – Syspect
    Commented Jan 23, 2014 at 12:17
  • In the template file log the array contents of $_data and $_info. Check the logged data
    – Sukeshini
    Commented Jan 24, 2014 at 5:39
0

Solution: the problem was in the $this->__(...) and $this->htmlEscape(...) functions. Now the working code for these 2 lines looks like that:

<?php echo 'BIC (Swift-code): '.$_info->getAccountSwift() ?><br />
<?php echo 'IBAN: '.$_info->getAccountIban() ?><br />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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