Display Voucher-Code on Prestashop Invoice. Simple SQL JOIN
<p>I want to display the voucher code a customer entered for his order on the PDF-invoice. The code for fetching the cart rules for the specific invoice looks like this.</p>

<pre><code>SELECT *
FROM `'._DB_PREFIX_.'order_cart_rule` ocr
WHERE ocr.`id_order` = '.(int)$this-&gt;id
</code></pre>

<p>This gets the amount of each voucher used, ID and so on, the voucher-codes itself however are located in a different table called "cart_rule". The two tables are connected by the "id_cart_rule" property. I want to join in the code for each cart rule so I can display it on the invoice. I guess it has to look something like this:</p>

<pre><code>SELECT *
FROM `'._DB_PREFIX_.'order_cart_rule` ocr

LEFT JOIN `'._DB_PREFIX_.'cart_rule` cr
ON ???

WHERE ocr.`id_order` = '.(int)$this-&gt;id);
</code></pre>

<p>I pretty much have no idea about SQL. Can someone help me with this?</p>