title: Prestashop Get combination product from id's
body: <p>I'm trying to display quantity, combinations and etc. on the product-list. So far i've got it to display the combinations just fine, so that i can select an attribute from each group assigned to the product.</p>
  
  <p>Now, how do i combine those "attribute id's" into a combination product, so that i can see prices, add it to cart etc.</p>
  
  <p>This is my module to fetch combinations</p>
  
  <pre><code>function hookdisplayProductOnList($params){
      $product=new Product($params['id_product']);
      $combinations=$product-&gt;getAttributeCombinations($this-&gt;context-&gt;language-&gt;id);
  
      $combArray = [];
      $combArrayIds = [];
  
      foreach( $combinations as $k =&gt; $v )
      {   
          if( !in_array($v["id_attribute"], $combArrayIds))
          {
              $combArrayIds[] = $v["id_attribute"];
              $combArray[ $v["group_name"] ][] = $v;
          }
      }
  
      $this-&gt;smarty-&gt;assign('combinations',$combArray);
      return $this-&gt;display(__FILE__, 'combinations.tpl');
  }
  </code></pre>
  
  <p>This is how i output the groups</p>
  
  <pre><code>{foreach $combinations as $k=&gt;$comb}
  
              &lt;ul class="attribute-select" data-group="{$k}"&gt;
              {foreach from=$comb item=attr}
                  &lt;li data-combId="{$attr.id_attribute}" title="{l s='+'} {convertPrice price=$attr.unit_price_impact}"&gt;{$attr.attribute_name}&lt;/li&gt;
              {/foreach}
              &lt;/ul&gt;&lt;br /&gt;
  
  
  {/foreach}
  </code></pre>
  
  <p>Is there any helper function or stuff like that. Like:</p>
  
  <pre><code>::GetByAttributes($product_id, [ attr_id1, attr_id2, attr_id3 ] );
  </code></pre>