Jump to content
Sign in to follow this  
sentq

Display Credit Balance In Six Template

Recommended Posts

Why is this not a default feature? Can't wait to try it out :)

what prevents you from using it? :)

Share this post


Link to post
Share on other sites

Excellent module, thanks!

How do I get it to show the credit balance only in the billing section?

Thank you in advance!

Share this post


Link to post
Share on other sites
How do I get it to show the credit balance only in the billing section?

you could modify the hook code and change...

 

    $filename = APP::getCurrentFileName();

   $client = Menu::context("client");

   $clientid = (int) $client->id;

   if ($filename!=='clientarea' || $clientid===0){
       return;
   }

to...

 

    $filename = APP::getCurrentFileName();
   $action = $_GET['action'];
   $allowed = array('invoices', 'quotes', 'masspay', 'addfunds');
   $client = Menu::context("client");

   $clientid = (int) $client->id;

   if ($filename!=='clientarea' || $clientid===0 || !in_array($action,$allowed)){
       return;
   }

if you do this, then the credit balance sidebar will only show on the invoice, quotes, masspay and addfunds pages.

Share this post


Link to post
Share on other sites
you could modify the hook code and change...

 

if you do this, then the credit balance sidebar will only show on the invoice, quotes, masspay and addfunds pages.

 

Oh excellent, thanks so much! Is that how that is done, great! Obviously I haven't spent much time

coding in the WHMCS environment. I was also able to put a conditional for the credit balance so it

only shows if the balance is above zero!

 

If anyone needs that my final is this, the balance also shows on the main/home page as well but not on

non billing related pages:

 

  add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $primarySidebar){

   $filename = APP::getCurrentFileName();

   $client = Menu::context("client");

   $clientid = (int) $client->id;
   $action = $_GET['action'];
   $allowed = array('invoices', 'quotes', 'masspay', 'addfunds','');

   if ($filename!=='clientarea' || $clientid===0 || !in_array($action,$allowed)){
       return;
   }
   if ($client->credit <= 0.00) { return; }

 

Thanks again brian! !!!

Edited by rkatz0

Share this post


Link to post
Share on other sites
Hi this is my first post and a big thanks this is just what i was looking for.

 

Phill

Phill, you're welcome :)

Share this post


Link to post
Share on other sites

For this issue permanent solution is

 

http://forums.whmcs.com/showthread.php?114126-Six-template-Small-Layout-Issue-Fix&p=462390#post462390

 

 

 

 

Thank you! hook works insanely well...

 

Found one issue, when in "Portal Home / Client Area / My Invoices" the Secondary_Sidebar-Billing module glitches out from the sidebar. Sorry not very familiar, learning whmcs as I go along. (See screenshot) Is there an easy fix to this?

 

Thanks in advance...

 

Once again Great Hook!!!

 

[ATTACH=CONFIG]9667[/ATTACH]

Share this post


Link to post
Share on other sites

Just for those wanting this module with the last modification without having to sort out the modification I've attached a copy.

 

I didn't code this or change it beyond including the modifications found in this thread already. I.e. I will not provide support :).

WHMCS_SixTemplateCreditBalance.php.zip

Share this post


Link to post
Share on other sites
Just for those wanting this module with the last modification without having to sort out the modification I've attached a copy.

 

I didn't code this or change it beyond including the modifications found in this thread already. I.e. I will not provide support :).

it will be displayed in the following pages only if client already has credit:

Home Page - My Invoices - My Quotes - Mass Payment - Add Funds

 

@MikeDVB thanks for sharing

Share this post


Link to post
Share on other sites

Hi, I am not able to download the ZIP file, keeps saying I have to login, even though I am logged in already, strange!?

Strange, now it worked :)

Just what I was searching for, thx a lot.

Share this post


Link to post
Share on other sites

Hello,

 

I just want to fix the bug that when someone try to verify his email address when he's already logged in, he gets the balance in the login page.

 

...

if ($filename!=='clientarea' || $clientid===0 || strpos($_SERVER['REQUEST_URI'], 'verificationId') !== false) {
   return;
}

...

 

Regards,

Share this post


Link to post
Share on other sites

This is great, really! Thank you for adding it.

 

However there is a problem on my installation where the "Actions" block are not aligned with the other blocks on the left side. Instead, it goes to the contents area. This happens for example when we open the EPP code page, but not all pages. Please see the screenshot: http://dns.d.pr/opM4Ex/ao4i5Lg9

 

Is there a way to fix this?

 

Thank you

Share this post


Link to post
Share on other sites
This is great, really! Thank you for adding it.

 

However there is a problem on my installation where the "Actions" block are not aligned with the other blocks on the left side. Instead, it goes to the contents area. This happens for example when we open the EPP code page, but not all pages. Please see the screenshot: http://dns.d.pr/opM4Ex/ao4i5Lg9

 

Is there a way to fix this?

 

Thank you

Hi,

 

Thank you :)

 

the issue is common with Template Six, here is the way to fix it: https://forum.whmcs.com/showthread.php?106891-Display-Credit-Balance-In-Six-Template&p=448314#post448314

Share this post


Link to post
Share on other sites
Hi,

 

Thank you :)

 

the issue is common with Template Six, here is the way to fix it: https://forum.whmcs.com/showthread.php?106891-Display-Credit-Balance-In-Six-Template&p=448314#post448314

 

Superb, it worked :)

 

Now, my store does not allow customers to Add Funds but the button to add funds is visible. Is it possible to remove the button and just display the existing credit (i.e. from refunds or manually added by us)? A php condition would be great, in case we enable the add funds in the future.

 

Thank you once again.

Share this post


Link to post
Share on other sites
Now, my store does not allow customers to Add Funds but the button to add funds is visible. Is it possible to remove the button and just display the existing credit (i.e. from refunds or manually added by us)?

to remove it permanently, just remove the footer code from the hook...

    $balancePanel->setFooterHtml(
       '<a href="clientarea.php?action=addfunds" class="btn btn-success btn-sm btn-block">
           <i class="fa fa-plus"></i> '.Lang::trans('Add Funds').'
       </a>'
   );

A php condition would be great, in case we enable the add funds in the future.

to make the footer conditional on the add funds feature being enabled, just wrap it in an if statement - there'd be a few ways to do that, checking the $CONFIG array would be the simplest, but as sentq is already using Capsule, we'll go down that route...

    $fundsenabled = Capsule::table('tblconfiguration')->where('setting','AddFundsEnabled')->value('value');

   if ($fundsenabled == "on") {

       $balancePanel->setFooterHtml(
           '<a href="clientarea.php?action=addfunds" class="btn btn-success btn-sm btn-block">
               <i class="fa fa-plus"></i> '.Lang::trans('Add Funds').'</a>'
       );
   }

if using WHMCS v6, you may need to change ->value('value') to ->pluck('value').

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Content

    • By Dsbush
      So,I have an issue where some of my product groups in my sidebar are doubling up. I want to get rid of the doubles. What would be the best course of action that is not too complicated. 
    • By Tycho
      Hello,
      https://gyazo.com/ae7b45883641d2bbd26482f3233e7af2
      I want everything on the left side bar gone. What's the best way to do that without an empty spot? So I want to have the panels in the middle.
      I've looked at google a lot but couldn't get out anyway.
    • By stevelack
      I am trying to remove the sidebar menu "Actions" from the My Products and Services page.  I have created the following hook:
      ```
      <?php
      use WHMCS\View\Menu\Item as MenuItem;
      add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
      {
         if (!is_null($primarySidebar->getChild('My Services Actions'))) {
                  $primarySidebar->removeChild('My Services Actions');
         }    
      });
      ```
      But it is not removing the sidebar from the page /clientarea.php?action=services
      What am I doing wrong?
      Thanks,
      Steve
    • By Web Host Pro
      Any idea what hook I can add to remove these side bar ads? I'm still selling these products? I just don't want them on the side bar right now. I might add them back later.
      I checked my current hooks and non seem to line up with these sidebar ads. I assume I need to add a new hook to remove these.
      Thanks for any help.

    • 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?
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

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