Jump to content
Anders

how do i add a button on clientare page.

Recommended Posts

Hi again :)

  1. i wish to add a button on client area page see screenshot how can i do that?
  2. i also wonder if is possible to show that button only to registered users and if a user become and active product/service client then the button will not show?

Regards Anders

Share this post


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

i wish to add a button on client area page see screenshot how can i do that?

it would be helpful to see the screenshot! 🙂

14 hours ago, Anders said:

i also wonder if is possible to show that button only to registered users and if a user become and active product/service client then the button will not show?

yes.

Share this post


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

sorry here is the pic

excellent choice of position - that is exactly where the ClientAreaHomepage hook would output it's HTML code. 🙂

15 hours ago, Anders said:

i also wonder if is possible to show that button only to registered users and if a user become and active product/service client then the button will not show?

<?php

add_hook('ClientAreaHomepage', 1, function($vars) {
	$client = Menu::context('client');
	$activeservices = $client->services->where('domainstatus','=','Active')->count();
	if ($client && $activeservices == 0) {
		return '<div class="text-center"><a type="button" class="btn btn-primary btn-lg" href="cart.php">Buy Some Services!</a></div><br />';
	}
});

Uh3s2ux.png

technically, I suppose "Buy Some Services" should be replaced by either an existing or custom language string, but I don't know what your intentions are for this button.

Share this post


Link to post
Share on other sites

Wow you are amazing :)

exactly what i needed  you are the best.

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

  • 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