Jump to content

How can customers activate their Affiliate account?


ScottN

Recommended Posts

The WHMCS Affiliate documentation says:

 

Activating an Affiliate

Clients can activate their affiliate account from the client area but you as an admin can do it from the client summary page also. To do that, locate the client you want to activate using the search or client list and then in the Actions panel click the Activate as Affiliate link.

 

When I log in as a client, and go to their Client Area, there is NOTHING about the Affiliate system.

 

If I manually activate them from the admin side, THEN there is an Affiliate Program section on their Client area.

 

How can I set it up so that clients can "activate their affiliate account" like the documentation states?

 

We are using the "six" theme, if that matters.

 

Thanks!

 

- Scott

Link to comment
Share on other sites

using the Six template, when a client is logged, they should see this on the navbar...

 

lAm2wCJ.png

 

in fact, with the Affiliates system enabled, there should be an Affiliates link on the navbar whether they're logged in or not - if it's not there for you, perhaps there is a hook removing it ?

Link to comment
Share on other sites

We are using a custom navbar, so I'm not surprised it's missing from the menu. But the documentation says nothing about the navbar and that's not my question. The docs say it should show up in the CLIENT AREA. I would like it to show up there, per the docs, but it's not there?

 

- Scott

Link to comment
Share on other sites

i'd agree with sentq on this - I would take the clientarea as being everything the client sees (including the navbar) when they login (the clientarea navbar changed when logged in) - now, if you've got a custom navbar, then fair enough it's not there - you just need to add a link somewhere to affiliates.php and the clients can activate their account.

Link to comment
Share on other sites

Hmmm, OK. I thought "Client Area" was the screen that clients see when they first login. When I manually activate the customer as an Affiliate, then a new "Affiliate Program" widget shows up in the Client Area:

 

client-area-affiliate-activated.jpg

 

Sounds like I will have to work on the menu, then (and try to re-learn what Client Area means). Thanks guys!

 

- Scott

Link to comment
Share on other sites

Scott,

 

alternatively, you could add a home page panel (widget) that includes a link to the affiliate page - simply

create a file in includes/hooks and call it 'affiliateinvitepanel.php' and add the code below...

 

<?php

use WHMCS\View\Menu\Item;

add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels)
{
   $client = Menu::context('client');
   $affiliate = $client->affiliate;
   if (!$affiliate){
                   $homePagePanels->addChild('Affiliate Invite', array(
                   'label' => Lang::trans('clientHomePanels.affiliateProgram'),
                   'icon' => 'fa-group',
                   'order' => 300,
                   'extras' => array(
                       'color' => 'teal',
                       'btn-link' => 'affiliates.php',
                       'btn-text' => Lang::trans('moreDetails'),
                       'btn-icon' => 'fa-arrow-right',),
                   'bodyHtml' => "<p>If you would like to take part in our Affiliate Program, click <a href=\"affiliates.php\">here</a> to activate your Affiliate account.</p>",
                   ));
   }
});

if the client is not currently an affiliate, it will show the panel below inviting them to join the program; if they are already an affiliate, then the above panel won't appear, but the one in your screenshot will - i've designed the invite panel to match the existing affiliate panel and will appear in the same location too.

 

RMgNeW8.png

 

feel free to change the text! :idea:

Link to comment
Share on other sites

Brian! That is amazing!! Thank you!!!!!!!! It looks and works great!!

I looked over the docs and don't readily see how one can change the order of the panels. Is that possible?

yes - their default values are shown in the table on the page below...

 

http://docs.whmcs.com/Working_With_Client_Area_Home_Page_Panels#Default_Panels

 

but to alter them, you need to use a hook - so if we take the "Domains Expiring Soon" panel as an example, it currently has an order value of 50, which means it's shown close to the top after unpaid and overdue invoices... let's say we want to move it to the very bottom of the page, we would just change it's order value to 600 (or anything greater than 500).

 

<?php
use WHMCS\View\Menu\Item;

add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels)
{
   if (!is_null($homePagePanels->getChild('Domains Expiring Soon'))) {
                   $homePagePanels->getChild('Domains Expiring Soon')
                                   ->setOrder(600);
   }
});

in practice, if you were changing the order of a number of panels at the same time, you could change them all in the same hook file...

 

<?php
use WHMCS\View\Menu\Item;

add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels)
{
   if (!is_null($homePagePanels->getChild('Domains Expiring Soon'))) {
                   $homePagePanels->getChild('Domains Expiring Soon')
                                   ->setOrder(600);
   }
   if (!is_null($homePagePanels->getChild('Recent News'))) {
                   $homePagePanels->getChild('Recent News')
                                   ->setOrder(5);
   }

});

... just remember to always check that a panel exists before you try to change it - that's what the 'if' statements are for in the above hooks.

Link to comment
Share on other sites

The code must be probably missing from the six template like other things.

 

Several things are actually missing in v6. For example when a customer has credits in his account, its not displayed anywhere anymore. Unless they go to an invoice. This is actually causing billing tickets because don't believe they have credits left in their account.

 

Another bug in the templating system that does not show the credits anywhere.

Link to comment
Share on other sites

The code must be probably missing from the six template like other things.

 

Several things are actually missing in v6. For example when a customer has credits in his account, its not displayed anywhere anymore. Unless they go to an invoice. This is actually causing billing tickets because don't believe they have credits left in their account.

 

Another bug in the templating system that does not show the credits anywhere.

 

This might help you: http://forum.whmcs.com/showthread.php?106891-Display-Credit-Balance-In-Six-Template

Link to comment
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.

×
×
  • 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