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>> </span>
</li>
<li class="youraccount">
<a title="" href="<?php echo $this->getUrl('customer/account/') ?>"><?php echo $this->__('Your Account') ?></a>
<span>> </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!