rade023 Posted December 28, 2020 Share Posted December 28, 2020 Hello Gus, I have one question I want to put the categories on the home page. Now I have seen you hook that I took. The question is whether it is possible that from that category he takes the first lowest price from that product. includes/hook/Products_Tables.php <?php // use Illuminate\Database\Capsule\Manager as Capsule; if (!defined("WHMCS")) die("This file cannot be accessed directly"); function hook_getProductGroups($vars) { $getProductGroups = Capsule::table('tblproductgroups') ->where('tblproductgroups.hidden', '0') ->select('id', 'name') ->orderBy('order', 'asc') ->get(); $encodedata = json_encode($getProductGroups); $decodedata = json_decode($encodedata, true); return array("productgroups" => $decodedata); } add_hook("ClientAreaPageHome", 1, "hook_getProductGroups"); homepage.tpl {foreach $productgroups as $pgroup} <div class="col-md-4"> <div class="panel panel-default"> <div class="panel-heading">{$pgroup.name}</div> <div class="panel-body"> <!-- Something like this {$pgroup.monthly}<span>/month --> </div> <div class="panel-footer"> <a href="cart.php?gid={$pgroup.id}" class="btn btn-primary">order</a> </div> </div> </div> {/foreach} i know there are probably made themes but i really can't find what i want 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 28, 2020 Share Posted December 28, 2020 8 hours ago, rade023 said: I want to put the categories on the home page. it's probably worth mentioning that in v8.1 (still in beta), if you choose the new '21' theme, then product categories are shown on the homepage by default... it's a very boring design, but the product groups will be there without the need for a hook. 8 hours ago, rade023 said: The question is whether it is possible that from that category he takes the first lowest price from that product. that's just a change to the query, but you'd have to be very specific about exactly what you were looking for... the lowest price could mean different things to different people - e.g is the actual lowest price $10 monthly instead of $100 annually, or is $100 annual the lowest price?? 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.