Jump to content

Display hosting package on home page


cstech

Recommended Posts

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... ?

xZWaXBe.png

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.

Link to comment
Share on other sites

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

home_debug.png

Link to comment
Share on other sites

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. 😕

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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. thanks.png

Link to comment
Share on other sites

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>

 

Link to comment
Share on other sites

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')	
Link to comment
Share on other sites

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')	

 

Link to comment
Share on other sites

  • 2 months later...

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