title: whmcs show active products per group
body: <p>I'm trying to create 4 custom pages in whmcs, each for every productgroup there is. The first page, Web Hosting, has to include all the active web hosting packages for a user. I know that I have to set the variables myself, but I don't understand it fully</p>
  
  <p>This gets the first domain in the table of the active services for a user.</p>
  
  <pre><code>$hostingProduct = Capsule::table('tblhosting')
        -&gt;where('userid', '=', $ca-&gt;getUserID())-&gt;pluck('domain');
  
    $ca-&gt;assign('hostingProduct', $hostingProduct);
  </code></pre>
  
  <p>What I want to do now is get all the domains that are active for a certain product group. In this table is there no easy way to determine the product group.
  Howerver there is the packageid. Packageid 1, 2, 3 and 4 I can use for this page. I also need the id of the product from this table.</p>
  
  <p>How do I get the right domains for those packageid's and the product id in an array? I want to call them like this in the .tpl file</p>
  
  <pre><code>{foreach $hostingProduct}
      &lt;div class="col-md-3"&gt;
          &lt;a href="clientarea.php?action=productdetails&amp;id={$productid}"&gt;{$domain}&lt;/a&gt;
      &lt;/div&gt;
  {/foreach}
  </code></pre>