Amit9713 Posted September 2, 2020 Share Posted September 2, 2020 Hi i tried to render the products on home page but it is not showing <?php use Illuminate\Database\Capsule\Manager as Capsule; function hook_getProductGroups($vars){ $getProductGroups = Capsule::table('tblproductgroups')->where('tblproductgroups.id','2')->select('id','name','headline','tagline')->first(); $decodedata = json_decode(json_encode($getProductGroups), true); return array("productgroup" => $decodedata); } add_hook("ClientAreaPageHome", 1, "hook_getProductGroups"); This is my hook and it not returning on homepage.tpl I used {debug} but no object is there 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 7, 2020 Share Posted September 7, 2020 On 02/09/2020 at 13:13, Amit9713 said: This is my hook and it not returning on homepage.tpl physically, it won't output anything in the template.. unless you've modified homepage.tpl to output the returned array. On 02/09/2020 at 13:13, Amit9713 said: I used {debug} but no object is there then are you sure that you have a product group #2? if you pass it a group that doesn't exist, then it won't return anything.... but if you give it a group that exists, it will return the selected information. 0 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.