I am building a vQmod for OC v1.5.5.1 to display the SKU at all points throughout the checkout and admin. I have nearly completed this but I have hit a brick wall on the admin sale order form (editing the order and adding products etc.).
Within the admin/view/template/sale/order_form.tpl file at line 1407 there is a reference to a product['model'] variable in the JavaScript section (full line below) but I can't seem to understand how this variable is set. Once I can work this out, I can proceed with the modification as I have set up the rest of the framework.
Line 1407:
Code: Select all
html += ' <td class="left">' + product['model'] + '<input type="hidden" name="order_product[' + product_row + '][model]" value="' + product['model'] + '" /></td>';
Code: Select all
html += ' <td class="left">' + product['sku'] + '<input type="hidden" name="order_product[' + product_row + '][sku]" value="' + product['sku'] + '" /></td>';
Please note that a new sku column on the order_product table has been created. All rows have data and all the respective model files have been updated accordingly. Viewing the order works perfectly at all points so far (front end and admin) and the SKU displays as intended.
Saving a new product through the order editor results in the text "undefined" being saved to the new SKU column in the order_product table.
TL;DR
Can anyone help to explain how the JavaScript product['model'] variable is set in the admin/view/template/sale/order_form.tpl file (line 1407 for v1.5.5.1 or line 1107 for v2.3.0.2)?
Which pipleline should I follow to establish where to add in code to correctly set the product['sku'] variable?