Jump to content

Recommended Posts

Hi everyone

Using this and its great, however i want to display it a different way in the custom theme im creating and i'm a bit stuck. 

 

Basically instead of having this in the sidebar i've created a custom area in the header on my theme and i want to display this as a dropdown item.  What way can i add this to the required section of my theme?

 

Share this post


Link to post
Share on other sites

Hi Matt,

21 hours ago, mwndesign said:

Basically instead of having this in the sidebar i've created a custom area in the header on my theme and i want to display this as a dropdown item.  What way can i add this to the required section of my theme?

it's difficult to tell without knowing exactly where you mean, e.g by theme do you mean WHMCS or WordPress... :?:

  • if it were in the navbar of a WHMCS page, you could use a navbar hook (primary or secondary) to display a balance.
  • if you wanted it as a panel on the homepage when the client is logged in...
  • if this header is within WHMCS, when the client is logged in, there will be a Smarty variable available - {$clientsdetails.credit} that stores the numeric balance (e.g with no currency prefix/suffix) of that client - though if they're logged in, you can access their currency too and add that to the output.
  • you could write an action hook (basically stripping out the sidebar code from sentq's hook) that could assign the credit balance, with the correct currency formatting already in it, to a new variable and that could be accessible in every WHMCS page.
  • if the header is outside of WHMCS (e.g WordPress), then you could use a data feed to get the balance, though there would be complications in verifying the user...

Share this post


Link to post
Share on other sites

Hi Brian

 

Thanks for the reply, i figured it out very late last night / early hours of this morning. 

The way i've got it set is within WHMCS.  I have created a custom theme and placed a button that shows a popover next to where the notifications area is displayed within the Six theme. 

I added debug into clientareahome and looked through the hooks that are found within the debug window.  This is what i am using now to display the clients account balance: {$clientsstats.creditbalance}

This displays the currency and also the amount within their account.

Share this post


Link to post
Share on other sites
14 hours ago, mwndesign said:

This is what i am using now to display the clients account balance: {$clientsstats.creditbalance}

good spot - i'd forgotten about that array.

  • Like 1

Share this post


Link to post
Share on other sites

It works fine for me, too. Thanks @brian!

The only issue i have is that the display is something like this: €587.45, although i have set  at Whmcs setup the currency to be displayed as €587,45

So, it is a bit confusing. Is there solution?

Share this post


Link to post
Share on other sites
21 minutes ago, Aris.N. said:

The only issue i have is that the display is something like this: €587.45, although i have set  at Whmcs setup the currency to be displayed as €587,45

So, it is a bit confusing. Is there solution?

quick fix is to change...

'label' => '<h4 style="text-align:center;">'.$pricegetCurrency['0']->prefix.$client->credit.' '. $getCurrency['0']->suffix.'</h4>',

to...

'label' => '<h4 style="text-align:center;">'.formatCurrency($client->credit, $client->currency).'</h4>',

and you no longer need the #Get Currency block of code... i've worked from the v1.1 version on page 1 and attached a modified file.

WHMCS_SixTemplateCreditBalance.php

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks a lot, I am using it from many years 😉

 

How to show this in Sidebar panel of every page whichever contain Sidebar? (Secondary Sidebar or every type of sidebar)

Share this post


Link to post
Share on other sites
25 minutes ago, DewlanceHosting said:

How to show this in Sidebar panel of every page whichever contain Sidebar? (Secondary Sidebar or every type of sidebar)

it's already displayed in every page except for pages where client are not logged-in, could you explain what you mean in more details?

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, sentq said:

it's already displayed in every page except for pages where client are not logged-in, could you explain what you mean in more details?

Oh, You are right.

 

I was thinking about adding it to non-logged in sidebar order category page but now I think it will be distraction to customer and they will start adding fund instead of purchasing product. ;)

 

How can I move css box to center. I use this css code in class ="col-sm-offset-3" (I even use col-sm-offset-4 but does not set in center)

Any help?

 

Screenshot attached.

gift-card.gif

Share this post


Link to post
Share on other sites
14 hours ago, DewlanceHosting said:

I was thinking about adding it to non-logged in sidebar order category page but now I think it will be distraction to customer and they will start adding fund instead of purchasing product. 😉

if they aren't logged in, how would you know how much their credit balance was ?

Share this post


Link to post
Share on other sites

If a user isn't logged in then it wouldn't pick anything up to display, as the information is pulled from the database for each user.

 

Edited by WHMCS ChrisD
Edited as per client request

Share this post


Link to post
Share on other sites
1 hour ago, brian! said:

if they aren't logged in, how would you know how much their credit balance was ?

Yes, I will not add this.

I saw this Widget already showing on most of pages.

Share this post


Link to post
Share on other sites

Any solution for fixing this issue? If I remove this hook then it go back to exact position. I tried to add space, <br>, etc code but can't get success from last 4 to 6 hours 😢

 

move it.png

Share this post


Link to post
Share on other sites
2 minutes ago, DewlanceHosting said:

Any solution for fixing this issue? If I remove this hook then it go back to exact position. I tried to add space, <br>, etc code but can't get success from last 4 to 6 hours 😢

it's a known issue with WHMCS when there are too much sidebar content - sentq posted a hook fix earlier in this thread

failing that, thememetro posted another similar fix...

basically it's a css issue - so one of them should solve it.

  • Party/Celebrate 1

Share this post


Link to post
Share on other sites
3 hours ago, Aris.N. said:

i was wondering if it is possible to display the clients credit balance info as a panel.

 

  • Thanks 1

Share this post


Link to post
Share on other sites

When you don't have the credit balance setup to auto pay invoices, how can the client pay an invoice using their credit balance?

Share this post


Link to post
Share on other sites
3 hours ago, Amcom said:

When you don't have the credit balance setup to auto pay invoices, how can the client pay an invoice using their credit balance?

I located the answer, from the unpaid invoice you can apply credit to pay the invoice.

Share this post


Link to post
Share on other sites

"We do not allow depositing funds in advance with us at the current time."

How can i enable that client allowed to add funds on their account.

Share this post


Link to post
Share on other sites
On 1/12/2019 at 4:32 PM, arsalahmed786 said:

"We do not allow depositing funds in advance with us at the current time."

How can i enable that client allowed to add funds on their account.

You need to enable it in the settings. 

Setup > General Settings > Credit & check the top box it says (" Tick this box to enable adding of funds by clients from the client area ")

Share this post


Link to post
Share on other sites
On 12/01/2019 at 16:32, arsalahmed786 said:

How can i enable that client allowed to add funds on their account.

https://docs.whmcs.com/Add_Funds

Quote

To enable the add funds option in the client area, go to Setup > General Settings > Credit and tick the enable box and configure the minimum and maximum amounts you want to allow.

  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By web2008
      In Standard Cart/sidebar-categories-collapsed.tpl the link to Register a New Doman  "cart.php?a=add&domain=register" hardcoded.
      Does anyone know how to change this link to e.g domainchecker.php?
    • By cdeese8
      Specifically, I desire having the "Support Knowledgebase Tag Cloud" sidebar panel title minimized on page load on knowledgebasearticle.tpl and knowledgebasecat.tpl pages.
      May you please recommend and share some wisdom? Might you know of a hook, that will automatically make it so the sidebar <div menuitemname="Support Knowledgebase Tag Cloud" class="panel panel-sidebar panel-sidebar"> is hidden / minimized by default?
      Thanks in advance for whatever help you can offer.
    • By web2008
      I need to add some Bootstrap Tooltip to the Sidebar under Manage Domain.
      Anyone who knows how this can be done?
    • By wp4all
      Hi @ all,
      I'm searching for a solution to hide on click the Sidebar.
      Has anyone ever had experience with it?
      I have already made single menu hide over a hook.
      Now I do not want to remove it completely but just let it slide out.
      The rest should of course be extended by this part.

      Could be also a commercial version.
      Thank you and best regards
      Christian
    • By web2008
      I have a menu/hook I want to display only for one or more product groups.Is there anyone who can help me with this?
      function sitebuilder_hook_sidebar($sidebar) {     $actions = $sidebar->getChild('Service Details Actions');     if ($actions) {         $actions->addChild('Sitebuilder', array(             'name' => 'Sitebuilder',             'label' => 'Sitebuilder',             'uri' => 'index.php?m=sitebuilder',             'order' => 999,             'attributes' => array(                 'target' => '_blank'  
  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated