title: How to add a custom product to cart in Prestashop 1.7?
body: <p>I want to create a specific module to add custom product. In this way, I developed the next source code (it's working) :</p>
  
  <pre><code>/* Data */
  $id_product = (int)Tools::getValue('id_product');
  $id_customization = (int)Tools::getValue('id_customization'); // = 0
  $price_product = (int)Tools::getValue('priceform'); // nouveau prix
  
  /* Create the cart */
  if(!$this-&gt;context-&gt;cart-&gt;id) {
  
      /* Detect the user logged */
      if($this-&gt;context-&gt;cookie-&gt;id_guest) {
          $guest = new Guest($this-&gt;context-&gt;cookie-&gt;id_guest);
          $this-&gt;context-&gt;cart-&gt;mobile_theme = $guest-&gt;mobile_theme;
      }
      $this-&gt;context-&gt;cart-&gt;add();
  
      /* Create the cookie */
      if($this-&gt;context-&gt;cart-&gt;id) {
          $this-&gt;context-&gt;cookie-&gt;id_cart = (int)$this-&gt;context-&gt;cart-&gt;id;
      }
  }
  
  /* Select the cart */
  $cart = $this-&gt;context-&gt;cart;
  
  /* Select the product */
  $product = new Product($id_product, true, (int)($this-&gt;context-&gt;cookie-&gt;id_lang));
  $id_product_attribute = Product::getDefaultAttribute($id_product);
  
  /* Add to cart */
  $cart-&gt;updateQty(1, $id_product, $id_product_attribute, $id_customization);
  </code></pre>
  
  <p>But I don't know, how to change the price, add the declination ($_POST['group[X]']) and add any more informations (string/varchar) ?</p>