Jump to content

rtofvnt

Member
  • Posts

    7
  • Joined

  • Last visited

Everything posted by rtofvnt

  1. sentq - you are star ! I'm getting there now. Does that mean every hook in /includes/hooks is called ? Also - if I have custom ie. sharedhosting.tpl template file will I be able to access those data from this hook ? Best regards - Matt
  2. Thanks for putting little bit of light on the subject, but it created some shadows that bringing more questions: 1. how should I name file with my custom function in /includes/hooks ? 2. how do I see if it actually works ? In /includes/hool/example.php file I created some basic function: function get_all_products() { $product_groups_query = "SELECT g.* FROM tblproductgroups g WHERE g.hidden <>1 ORDER BY g.order ASC"; $groups = full_query($product_groups_query); foreach($groups as $group) { echo '<pre>'; var_dump($group); echo '</pre>'; } } and then within the same file at the bottom: add_hook("ClientAdd",1,"get_all_products"); Cheers - Matt.
  3. Thanks sentq. I think I'm doing something fundamentally wrong anyway. My aim was to create in template on homepage table of product groups and products, so what I did was: duplicated default template and renamed, in header.tpl at the very top added: <code>{include_php file='templates/ultimatehosting/config.php'}</code> where in config.php I initialize new mysqli object and use that to create array of product groups and products which I'm assigning as smarty variable. Then in homepage.tpl I'm looping through and that's it. <code>$smarty->assign(... </code> - not working. I'm not sure if hooks will let me achieve what I'm looking for. On the other note I'm considering actually to not even using this whmcs system at all - I'm paying lease licence every month but updates that don't care about backward compatibility - that's really bad practice. Thanks for looking at it. Cheers
  4. Hi, I think I've lost quite a few brain cells ... or maybe not. I can't figure it out or find in in manual. In my template I have nice custom mysql queries that producing nice array of product groups / products. Before 6 I could just do: $this->assign('products',$products); but now it throws an error: all to a member function assign() on a non-object in array $product is ok - I var_dump it ant it's ok. I know something has been changed, but I can't find it. Please - any help ? Thanks - Matt.
  5. Thanks brian! - his is very close to what I was looking for. The only pain is that this php script adds every line <br> So far I think about actually do my own sql query: selec all product groups and then for each group query products and prices, as I'd love to use really fancy product list I've created on one of my templates I'm selling. Thanks.
  6. Hi, I tried to find in this forum (and some unsucesfull googling) how can I in homepage.tpl use arrays $productgroups. When I use {debug} I can see only productgroups in cart section. Is it possible ? I'd love to show my products / groups on index page. Thanks.
  7. Hi, I just updated to 5.1.2. I've got two custom templates - I can select them in admin section however client area displays only default. Regards - Matt.
×
×
  • 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