brian! Posted February 28, 2019 Share Posted February 28, 2019 15 hours ago, cstech said: I tested the hook with adding {$productgroupname} {$productgrouphead}{$productgrouptag} {debug} at the end of the homepage.tpl in six native template, no things happened nor error nor separated windows opened! perhaps you still have popup windows disabled in the Chrome settings - they are disabled by default... ? https://support.google.com/chromebook/answer/95472?hl=en as steven said, you're either editing the wrong template, or Chrome is blocking the popup... if you're checking the right template, and it contains {debug}, then it should at least be trying to open a popup and I suspect that it is. 1 Quote Link to comment Share on other sites More sharing options...
cstech Posted February 28, 2019 Author Share Posted February 28, 2019 1 hour ago, brian! said: perhaps you still have popup windows disabled in the Chrome settings - they are disabled by default... ? Now the debug work here the screenshot. But if I activate the hook and adding on the buttom of homepage.tpl {$productgroupname} {$productgrouphead}{$productgrouptag} I don't get anythings, no error, no debug pop up and no products group shown 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 28, 2019 Share Posted February 28, 2019 37 minutes ago, cstech said: Now the debug work here the screenshot. praise be - it works! I see that you've got hooks running - one creating $productgroup and another creating the three variables - you only need to use one hook, not both. 37 minutes ago, cstech said: But if I activate the hook and adding on the bottom of homepage.tpl {$productgroupname} {$productgrouphead}{$productgrouptag} I don't get anythings, no error, no debug pop up and no products group shown if the popup window is already open, then it will refresh the window with the updated variables. if it's not opening, then you must be editing the wrong template - I can't see how you can get a popup that shows the variables are available and then not be able to use them in the template. 😕 0 Quote Link to comment Share on other sites More sharing options...
cstech Posted February 28, 2019 Author Share Posted February 28, 2019 36 minutes ago, brian! said: praise be - it works! Je vous en prie Monsieur @brian! Your help is so great and appreciated much. Thank you 38 minutes ago, brian! said: I see that you've got hooks running - one creating $productgroup and another creating the three variables - you only need to use one hook, not both. I feel I need some time and more concentration to achieve this, because I use at least 3 hook to reproduce the all permium_comparaison orderform on six homepage template. 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted February 28, 2019 Share Posted February 28, 2019 I'm wondering if there is a hidden smarty error happening that is preventing the items from working. Take a backup of homepage.tpl and then strip down elements in homepage.tpl until it starts working for at least the debug. After that add back elements until it starts to work. In the past what has stopped smarty from working for me is javascript junk and have to use the literal tags . So check if that is needed with your changes. 1 Quote Link to comment Share on other sites More sharing options...
cstech Posted February 28, 2019 Author Share Posted February 28, 2019 Woow it work! finaly the variables {$productgroupname} {$productgrouphead} {$productgrouptag} should not be placed anywhere, their places should be inside with commenting some natives variables of premium_comparison. The last and not realy required to have the exact premium_comparaison like a cart in the home page is the format of price. The currency format displayed like stored in the database exemple 00000.00 <div class="txt-center"> <h3 id="headline"> {$productgrouphead} <!-- {if $productGroup.headline} {$productGroup.headline} {else} {$productGroup.name} {/if} --> </h3> {if $productGroup.tagline} <h5 id="tagline"> {$productgrouptag} <!-- {$productGroup.tagline} --> </h5> {/if} {if $errormessage} <div class="alert alert-danger"> {$errormessage} </div> {/if} </div> I really dream to had a coffee with you @brian! @steven99, thank you infinite 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 1, 2019 Share Posted March 1, 2019 16 hours ago, cstech said: I feel I need some time and more concentration to achieve this, because I use at least 3 hook to reproduce the all premium_comparison orderform on six homepage template. at the end, you should only need one hook. 1️⃣ 13 hours ago, cstech said: Woow it work! finally the variables {$productgroupname} {$productgrouphead} {$productgrouptag} should not be placed anywhere, their places should be inside with commenting some natives variables of premium_comparison. you should be able to put them *anywhere*. 13 hours ago, cstech said: The last and not really required to have the exact premium_comparison like a cart in the home page is the format of price. The currency format displayed like stored in the database example 00000.00 that is simple to do - but it might be easier if you send me (via the Private Message option), your three separate hooks and your homepage.tpl template and at the weekend, i'll merge them into one hook and fix the currency issue at the same time. 1 Quote Link to comment Share on other sites More sharing options...
wedangsusu Posted March 6, 2019 Share Posted March 6, 2019 Hello i have follow instructions same like this link https://whmcs.community/topic/271417-product-info-on-custom-pages/, but still my product not showing on homepage, can you help me this my hook file pricetable.php <?php use Illuminate\Database\Capsule\Manager as Capsule; function homepage_products_hook($vars) { $products = Capsule::table('tblproducts') ->join('tblpricing', 'tblproducts.id', '=', 'tblpricing.relid') ->where('tblpricing.type', 'product') ->where('tblproducts.hidden','0') ->where('tblproducts.gid','1') ->select('tblproducts.id','tblproducts.name','tblproducts.description','tblpricing.monthly') ->orderBy('tblproducts.order') ->groupBy('tblproducts.id') ->get(); $results = json_decode(json_encode($products), true); return array("myproducts" => $results); } add_hook("ClientAreaPage", 1, "homepage_products_hook"); ?> and this query product.tpl on my homepage <table> <tr><th>Name</th><th>Description</th><th>Monthly Price</th></tr> {foreach $myproducts as $myproduct} <tr><td>{$myproduct.name}</td><td>{$myproduct.description}</td><td>{$myproduct.monthly}</td></tr> {/foreach} </table> 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 6, 2019 Share Posted March 6, 2019 8 hours ago, wedangsusu said: but still my product not showing on homepage, can you help me is it outputting anything ? in the line below, you specify the product group ID to use - are you using the correct product group ID value ?? ->where('tblproducts.gid','1') 0 Quote Link to comment Share on other sites More sharing options...
wedangsusu Posted March 7, 2019 Share Posted March 7, 2019 Thanks Brian, you are HERO it's work, this is my fault, wrong file placement 9 hours ago, brian! said: is it outputting anything ? in the line below, you specify the product group ID to use - are you using the correct product group ID value ?? ->where('tblproducts.gid','1') 0 Quote Link to comment Share on other sites More sharing options...
yasweb Posted May 7, 2019 Share Posted May 7, 2019 total results = "5" from hooks ? 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.