Jump to content

Display Products on Homepage

Recommended Posts

Hello, I am a newbie here, I am developing a custom template for my company based on the Latest Twenty-One system theme.

The theme works well but I have a problem trying to create a hook that queries products and return them to the $myproducts variable using the

ClientAreaPage hook but I have failed to get my hook running, on checking Activity log I see Hook Debug: No Hook functions defined for ClientAreaPage.


use WHMCS\Database\Capsule;

function homepage_products_hook($vars)
	$products = Capsule::table('tblproducts')
		->join('tblpricing', 'tblproducts.id', '=', 'tblpricing.relid')
		->where('tblpricing.type', 'product')
	$results = json_decode(json_encode($products), true);
	return array("myproducts" => $results);
add_hook("ClientAreaPage", 1, "homepage_products_hook");

I have created that file in `includes/hooks/homepage_products_hook.php`.

Is there anything am doing wrong? I need your help.

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.

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