add multi columns in many-to-many relation using fk-relation in xcrud
<p>I have three tables :</p>

<p>orders :</p>

<pre><code>id_order PK int
id_client
.
.
.
etc ...
</code></pre>

<p>Products : </p>

<pre><code>id_product PK int
product_name  varchar(255)
.
.
.
etc ...
</code></pre>

<p>orders_products</p>

<pre><code>id  PK int
id_order  FK int
id_product   FK int
quantity    int
discount    float
</code></pre>

<p>and Im using Xcrud as a crud framework based.</p>

<p>this is my code :</p>

<pre><code>    $xcrud = Xcrud::get_instance();
    $xcrud-&gt;table('orders');
    $xcrud-&gt;fk_relation('Products','id_order','orders_products','id_order','id_product','products', 'id_product','product_name');
</code></pre>

<ul>
<li>So each order has multi products</li>
<li>And each product has a quantity</li>
</ul>

<p>When I go to add an order it only shows me a multiselect field of products and it's inserting products find in the orders_products table.</p>

<p>but I want to add for each product a quantity.</p>

<p>How can I do that using xcrud ?</p>