I am developing a custom subscription module for one of my projects. A customer can have multiple subscriptions for multiple products. The data is stored in a custom database table. In the my accounts section I have added a link in the menu as follows:
<customer_account>
<reference name="customer_account_navigation">
<action method="addLink" translate="label" module="beyondroid_subscribepro"><name>subscriptions</name><path>subscriptions</path><label>My Subscriptions</label></action> </reference>
</customer_account>
<subscriptions_index_index translate="label">
<update handle="customer_account" />
<reference name="my.account.wrapper">
<block type="beyondroid_subscribepro/mysubscriptions" name="mysubscriptions" as="mysubscriptions" template="subscribepro/mysubscriptions.phtml" before="content" />
</reference>
</subscriptions_index_index>
The link redirects to a custom block, where I list each of the subscription object for that customer. Each subscription item has a balance_amount field that shows how much amount for that subscription is left in the customers account.
Now what I am trying to achieve is to show the total of each subscriptions balance amount in the link label in the customer account navigation menu.
If you look at the code above you can see currently the label shows My Subscriptions
. So if a customer has 3 subscriptions with $15 balance in each subscription item, I would like to show My Subscriptions (Balance : $45)
in the link label.
If I have a php function that adds up the subscription amounts, How can I include it in the above xml code to the <label></label>
tag ? Is this even possible at all ?