0

I am trying to display a customer's billing agreement information inside the customer account page but for some reason it won't show the billing agreement just the default "There are no billing agreements yet."

I can use the billing agreement information (saved credit card) when I checkout so I know it has been created I simply need to show it inside the customer account page.

Here is my code:

<div class="breadcrumbs">
    <ul>
                    <li class="home">
                            <a title="" href="<?php echo Mage::getBaseUrl(); ?>"><?php echo $this->__('Home')  ?></a>
                                        <span>&gt; </span>
                        </li>
                         <li class="youraccount">
                            <a title="" href="<?php echo $this->getUrl('customer/account/') ?>"><?php echo $this->__('Your Account')  ?></a>
                                        <span>&gt; </span>
                        </li>
                    <li class="payment">
                               <strong><?php echo $this->__('Payment')  ?></strong>

                        </li>

      </ul>
</div>
<div class="page-title title-buttons">
    <h1><?php echo $this->__('Payment') ?></h1>
</div>
 <?php Mage::app()->getLayout()->getMessagesBlock()->setMessages(Mage::getSingleton('customer/session')->getMessages(true)); ?>
<?php //echo $this->getMessagesBlock()->getGroupedHtml() ?>
<div class="my-account">
    <div class="tabcontainer">
        <ul>
            <li class="active"><a href="#" rel="#one"><?php echo $this->__('Your Billing Addresses') ?></a></li>
            <li><a href="#" rel="#two"><?php echo $this->__('Your Billing Agreements') ?></a></li>

        </ul>
    </div>
    <div id="one" class="cont-sec" style="display:block">
        <?php echo $this->getChildHtml('account_address'); ?>
    </div>
    <div id="two" class="cont-sec">
       <?php echo $this->getChildHtml('account_payment'); ?>
    </div>

</div>
<script type="text/javascript">
    jQuery(function() {
        jQuery('.tabcontainer ul li').click(function() {
            jQuery('.tabcontainer ul li').removeClass('active');
            jQuery('.cont-sec').hide();
            var curRel =  jQuery('a', jQuery(this)).attr('rel');
            jQuery(curRel).show();
            jQuery(this).addClass('active'); 
            return false;
        });

    });
</script>

I am using the childHtml method to call the sales/billing_agreements template file

<?php echo $this->getChildHtml('account_payment'); ?>

But something isn't right and I'm not sure what it is???

Please help somebody!

1 Answer 1

0

Had to invoke the correct block inside my custom.xml file

 <reference name="content">
    <block type="sales/billing_agreements" name="customer.account.billing.agreement" as="billing_agreements" template="accounttab/payment.phtml" >
 </reference>
1
  • where do you put this? Mar 13, 2020 at 10:05

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.