Remco Official Posted March 27, 2020 Share Posted March 27, 2020 How can i add a custom hook to a whmcs page my page wil not show carts http://prntscr.com/rnii1rhttp://prntscr.com/rniibp 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 27, 2020 Share Posted March 27, 2020 (edited) 14 hours ago, Remco Official said: How can i add a custom hook to a whmcs page https://developers.whmcs.com/hooks/getting-started/ three points to remember are... these hooks need to use existing hook points - so where you've used 'memory' and 'ssd' in your add_hooks, these need to refer to a relevant hook point listed in the index, e.g ClientAreaPageCart etc - what you want to do, and especially where/when, will determine the correct hook point to use. usually, you would use the hook to return the results array back to the template and then output the results in the template - generally, echoing wouldn't work and you definitely wouldn't have any control over where the output would be by using that method. i'm confused as to what you're trying to do, but if this is the cart, the template should already have access to configoptions 2 & 3 already without the need for a hook. Edited March 27, 2020 by brian! 0 Quote Link to comment Share on other sites More sharing options...
Remco Official Posted March 27, 2020 Author Share Posted March 27, 2020 yes i need configoptions 1, 2, 3, 4 en 5 how can i get that 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 27, 2020 Share Posted March 27, 2020 where/when do you want to use them ? 0 Quote Link to comment Share on other sites More sharing options...
Remco Official Posted March 27, 2020 Author Share Posted March 27, 2020 cart.php on the site but the products.php file 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 27, 2020 Share Posted March 27, 2020 you mean the products.tpl template file ?? and you're talking about the moduleconfigoptions ? e.g the values in the tblproducts database table ?? you do realise they may be different/empty depending on the module assigned to the product ??? 0 Quote Link to comment Share on other sites More sharing options...
Remco Official Posted March 27, 2020 Author Share Posted March 27, 2020 yes that that is what i searts 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 27, 2020 Share Posted March 27, 2020 (edited) the hook will add those values to the array (it's not currently doing any validation on the results), and returns the modified array to the template. you can then edit products.tpl and output them wherever you want to inside the foreach loop on the page, e.g {$product.configoption1} Edited March 27, 2020 by brian! 0 Quote Link to comment Share on other sites More sharing options...
Remco Official Posted March 27, 2020 Author Share Posted March 27, 2020 http://prntscr.com/rnwvtghttp://prntscr.com/rnwwa6 my page wil black 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 27, 2020 Share Posted March 27, 2020 did you delete your other hook ? 0 Quote Link to comment Share on other sites More sharing options...
Remco Official Posted March 27, 2020 Author Share Posted March 27, 2020 yes i deleted 0 Quote Link to comment Share on other sites More sharing options...
Remco Official Posted March 27, 2020 Author Share Posted March 27, 2020 i get now no date 0 Quote Link to comment Share on other sites More sharing options...
Remco Official Posted March 27, 2020 Author Share Posted March 27, 2020 {$products.configoption3} 0 Quote Link to comment Share on other sites More sharing options...
Remco Official Posted March 27, 2020 Author Share Posted March 27, 2020 http://prntscr.com/rnxapi 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 27, 2020 Share Posted March 27, 2020 5 minutes ago, Remco Official said: {$products.configoption3} it would be {$product.configoption3} 0 Quote Link to comment Share on other sites More sharing options...
Remco Official Posted March 27, 2020 Author Share Posted March 27, 2020 it wil not show eniting http://prntscr.com/rnxjom 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 27, 2020 Share Posted March 27, 2020 add {debug} to the template - that will generate a popup window of the arrays in the template and check the $products array to see what these values are for each product - remember to remove {debug} from the template when you're finished. 0 Quote Link to comment Share on other sites More sharing options...
Remco Official Posted March 27, 2020 Author Share Posted March 27, 2020 http://prntscr.com/rnyf3nhttp://prntscr.com/rnyfgm i get no debug?? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 28, 2020 Share Posted March 28, 2020 17 hours ago, Remco Official said: i get no debug?? it would generate a popup window - are you blocking popup windows in your browser? 0 Quote Link to comment Share on other sites More sharing options...
Remco Official Posted March 28, 2020 Author Share Posted March 28, 2020 i dont block windos popups 0 Quote Link to comment Share on other sites More sharing options...
Remco Official Posted March 28, 2020 Author Share Posted March 28, 2020 $products Origin: "Smarty object" Value Array (9)0 => Array (13) pid => 1 bid => 0 type => "hostingaccount" name => "Dirt" description => "" features => Array (0) featuresdesc => "" paytype => "recurring" pricing => Array (6) type => "recurring" monthly => "€0,40 EUR Maandelijks + €0,25 EUR setup/verzendkosten" hasconfigoptions => false cycles => Array (1) monthly => "€0,40 EUR Maandelijks + €0,25 EUR setup/verzendkosten" rawpricing => Array (12) msetupfee => "0.25" qsetupfee => "0.00" ssetupfee => "0.00" asetupfee => "0.00" bsetupfee => "0.00" tsetupfee => "0.00" monthly => "0.40" quarterly => "-1.00" semiannually => "-1.00" annually => "-1.00" biennially => "-1.00" triennially => "-1.00" minprice => Array (6) price => WHMCS\View\Formatter\Price Object (0) setupFee => WHMCS\View\Formatter\Price Object (0) cycle => "monthly" simple => "€0,40" cycleText => "<span>€0,40</span>/mnd" cycleTextWithCurrency => "<span>€0,40 EUR</span>/mnd" freedomain => "" freedomainpaymentterms => Array (0) qty => "" isFeatured => false1 => Array (13) pid => 2 bid => 0 type => "hostingaccount" name => "Grass" description => "" features => Array (0) featuresdesc => "" paytype => "recurring" pricing => Array (6) type => "recurring" monthly => "€0,80 EUR Maandelijks + €0,25 EUR setup/verzendkosten" hasconfigoptions => false cycles => Array (1) monthly => "€0,80 EUR Maandelijks + €0,25 EUR setup/verzendkosten" rawpricing => Array (12) msetupfee => "0.25" qsetupfee => "0.00" ssetupfee => "0.00" asetupfee => "0.00" bsetupfee => "0.00" tsetupfee => "0.00" monthly => "0.80" quarterly => "-1.00" semiannually => "-1.00" annually => "-1.00" biennially => "-1.00" triennially => "-1.00" minprice => Array (6) price => WHMCS\View\Formatter\Price Object (0) setupFee => WHMCS\View\Formatter\Price Object (0) cycle => "monthly" simple => "€0,80" cycleText => "<span>€0,80</span>/mnd" cycleTextWithCurrency => "<span>€0,80 EUR</span>/mnd" freedomain => "" freedomainpaymentterms => Array (0) qty => "" isFeatured => false2 => Array (13) pid => 3 bid => 0 type => "hostingaccount" name => "Cobbelstone" description => "" features => Array (0) featuresdesc => "" paytype => "recurring" pricing => Array (6) type => "recurring" monthly => "€1,60 EUR Maandelijks + €0,25 EUR setup/verzendkosten" hasconfigoptions => false cycles => Array (1) monthly => "€1,60 EUR Maandelijks + €0,25 EUR setup/verzendkosten" rawpricing => Array (12) msetupfee => "0.25" qsetupfee => "0.00" ssetupfee => "0.00" asetupfee => "0.00" bsetupfee => "0.00" tsetupfee => "0.00" monthly => "1.60" quarterly => "-1.00" semiannually => "-1.00" annually => "-1.00" biennially => "-1.00" triennially => "-1.00" minprice => Array (6) price => WHMCS\View\Formatter\Price Object (0) setupFee => WHMCS\View\Formatter\Price Object (0) cycle => "monthly" simple => "€1,60" cycleText => "<span>€1,60</span>/mnd" cycleTextWithCurrency => "<span>€1,60 EUR</span>/mnd" freedomain => "" freedomainpaymentterms => Array (0) qty => "" isFeatured => false3 => Array (13) pid => 4 bid => 0 type => "hostingaccount" name => "Stone" description => "" features => Array (0) featuresdesc => "" paytype => "recurring" pricing => Array (6) type => "recurring" monthly => "€2,40 EUR Maandelijks + €0,25 EUR setup/verzendkosten" hasconfigoptions => false cycles => Array (1) monthly => "€2,40 EUR Maandelijks + €0,25 EUR setup/verzendkosten" rawpricing => Array (12) msetupfee => "0.25" qsetupfee => "0.00" ssetupfee => "0.00" asetupfee => "0.00" bsetupfee => "0.00" tsetupfee => "0.00" monthly => "2.40" quarterly => "-1.00" semiannually => "-1.00" annually => "-1.00" biennially => "-1.00" triennially => "-1.00" minprice => Array (6) price => WHMCS\View\Formatter\Price Object (0) setupFee => WHMCS\View\Formatter\Price Object (0) cycle => "monthly" simple => "€2,40" cycleText => "<span>€2,40</span>/mnd" cycleTextWithCurrency => "<span>€2,40 EUR</span>/mnd" freedomain => "" freedomainpaymentterms => Array (0) qty => "" isFeatured => false4 => Array (13) pid => 5 bid => 0 type => "hostingaccount" name => "Coal" description => "" features => Array (0) featuresdesc => "" paytype => "recurring" pricing => Array (6) type => "recurring" monthly => "€3,20 EUR Maandelijks + €0,25 EUR setup/verzendkosten" hasconfigoptions => false cycles => Array (1) monthly => "€3,20 EUR Maandelijks + €0,25 EUR setup/verzendkosten" rawpricing => Array (12) msetupfee => "0.25" qsetupfee => "0.00" ssetupfee => "0.00" asetupfee => "0.00" bsetupfee => "0.00" tsetupfee => "0.00" monthly => "3.20" quarterly => "-1.00" semiannually => "-1.00" annually => "-1.00" biennially => "-1.00" triennially => "-1.00" minprice => Array (6) price => WHMCS\View\Formatter\Price Object (0) setupFee => WHMCS\View\Formatter\Price Object (0) cycle => "monthly" simple => "€3,20" cycleText => "<span>€3,20</span>/mnd" cycleTextWithCurrency => "<span>€3,20 EUR</span>/mnd" freedomain => "" freedomainpaymentterms => Array (0) qty => "" isFeatured => false5 => Array (13) pid => 6 bid => 0 type => "hostingaccount" name => "Iron" description => "" features => Array (0) featuresdesc => "" paytype => "recurring" pricing => Array (6) type => "recurring" monthly => "€4,00 EUR Maandelijks + €0,25 EUR setup/verzendkosten" hasconfigoptions => false cycles => Array (1) monthly => "€4,00 EUR Maandelijks + €0,25 EUR setup/verzendkosten" rawpricing => Array (12) msetupfee => "0.25" qsetupfee => "0.00" ssetupfee => "0.00" asetupfee => "0.00" bsetupfee => "0.00" tsetupfee => "0.00" monthly => "4.00" quarterly => "-1.00" semiannually => "-1.00" annually => "-1.00" biennially => "-1.00" triennially => "-1.00" minprice => Array (6) price => WHMCS\View\Formatter\Price Object (0) setupFee => WHMCS\View\Formatter\Price Object (0) cycle => "monthly" simple => "€4,00" cycleText => "<span>€4,00</span>/mnd" cycleTextWithCurrency => "<span>€4,00 EUR</span>/mnd" freedomain => "" freedomainpaymentterms => Array (0) qty => "" isFeatured => false6 => Array (13) pid => 7 bid => 0 type => "hostingaccount" name => "Lapiz" description => "" features => Array (0) featuresdesc => "" paytype => "recurring" pricing => Array (6) type => "recurring" monthly => "€8,00 EUR Maandelijks" hasconfigoptions => false cycles => Array (1) monthly => "€8,00 EUR Maandelijks" rawpricing => Array (12) msetupfee => "0.00" qsetupfee => "0.00" ssetupfee => "0.00" asetupfee => "0.00" bsetupfee => "0.00" tsetupfee => "0.00" monthly => "8.00" quarterly => "-1.00" semiannually => "-1.00" annually => "-1.00" biennially => "-1.00" triennially => "-1.00" minprice => Array (6) price => WHMCS\View\Formatter\Price Object (0) setupFee => 0 cycle => "monthly" simple => "€8,00" cycleText => "<span>€8,00</span>/mnd" cycleTextWithCurrency => "<span>€8,00 EUR</span>/mnd" freedomain => "" freedomainpaymentterms => Array (0) qty => "" isFeatured => false7 => Array (13) pid => 8 bid => 0 type => "hostingaccount" name => "Gold" description => "" features => Array (0) featuresdesc => "" paytype => "recurring" pricing => Array (6) type => "recurring" monthly => "€12,00 EUR Maandelijks" hasconfigoptions => false cycles => Array (1) monthly => "€12,00 EUR Maandelijks" rawpricing => Array (12) msetupfee => "0.00" qsetupfee => "0.00" ssetupfee => "0.00" asetupfee => "0.00" bsetupfee => "0.00" tsetupfee => "0.00" monthly => "12.00" quarterly => "-1.00" semiannually => "-1.00" annually => "-1.00" biennially => "-1.00" triennially => "-1.00" minprice => Array (6) price => WHMCS\View\Formatter\Price Object (0) setupFee => 0 cycle => "monthly" simple => "€12,00" cycleText => "<span>€12,00</span>/mnd" cycleTextWithCurrency => "<span>€12,00 EUR</span>/mnd" freedomain => "" freedomainpaymentterms => Array (0) qty => "" isFeatured => false8 => Array (13) pid => 9 bid => 0 type => "hostingaccount" name => "Diamond" description => "" features => Array (0) featuresdesc => "" paytype => "recurring" pricing => Array (6) type => "recurring" monthly => "€16,00 EUR Maandelijks" hasconfigoptions => false cycles => Array (1) monthly => "€16,00 EUR Maandelijks" rawpricing => Array (12) msetupfee => "0.00" qsetupfee => "0.00" ssetupfee => "0.00" asetupfee => "0.00" bsetupfee => "0.00" tsetupfee => "0.00" monthly => "16.00" quarterly => "-1.00" semiannually => "-1.00" annually => "-1.00" biennially => "-1.00" triennially => "-1.00" minprice => Array (6) price => WHMCS\View\Formatter\Price Object (0) setupFee => 0 cycle => "monthly" simple => "€16,00" cycleText => "<span>€16,00</span>/mnd" cycleTextWithCurrency => "<span>€16,00 EUR</span>/mnd" freedomain => "" freedomainpaymentterms => Array (0) qty => "" isFeatured => false Found it but ido no what the error is 0 Quote Link to comment Share on other sites More sharing options...
Remco Official Posted March 29, 2020 Author Share Posted March 29, 2020 i have found it thanks 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.