Jump to content

how do i add a button on clientare page.


Anders

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

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

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

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.

  • 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