Adding product attributes to opencart invoice
<p>I am trying to show product attributes on the Print Invoice page in <code>Opencart</code> version <code>2.0.1.1</code>.</p>

<p>So far I have edited <code>admin/controller/sale/order.php</code> by adding <code>$this-&gt;load-&gt;model("catalog/product");</code></p>

<p>Then I have added 'attribute' => <code>$this-&gt;model_catalog_product-&gt;getProductAttributes($product['product_id'])</code> to the <code>$product_data[] = array()</code></p>

<p>Now on the <code>order_invoice.tpl</code> page I have used <code>&lt;?php print_r ($attribute);?&gt;</code> to see what data it is pulling and it shows:</p>

<pre><code>Array
(
[attribute_id] =&gt; 1
[product_attribute_description] =&gt; Array
    (
        [1] =&gt; Array
            (
                [text] =&gt; 240
            )

    )

)
</code></pre>

<p>The <code>[text] =&gt; 240</code> is the value of the attribute but I cannot for the life of me get the attribute name to show up, I have tried numerous attempts and as most commonly suggested I've tried <code>$attribute['name'];</code> but this brings up nothing. </p>

<p>Can someone please explain how I can properly retrieve the attribute name and attribute value.</p>