New Zenner
- Join Date:
- Nov 2012
- Posts:
- 7
- Plugin Contributions:
- 0
adding product attributes to invoice
We make a lot of custom products and for some reason, all of the personalization attributes are visible on the order detail screen but not on the invoice. I've looked at invoice.php and it seems to be calling the right data fields, but not all of them display.
**
Sample order details:**
1 x "A Personalized" Custom Frame
- Theft Resistant Hardware: 4 Metric Silver Locking N & B (+$5.95)
- Hardware Snap On Covers: Set of 4 Chrome Color (+$4.95)
- Bottom Strip: HOSSOME
- Comments: only bottom-leave the top chrome
- Frame Color: Chrome Frame
- Color Strip: Black Background / Silver Letters
Sample invoice text (from the same order):
1 x "A Personalized" Custom Frame
- Theft Resistant Hardware: 4 Metric Silver Locking N & B (+$5.95)
- Hardware Snap On Covers: Set of 4 Chrome Color (+$4.95)
- Bottom Strip: HOSSOME
- Comments: only bottom-leave the top chrome
- Frame Color: Chrome Frame
(missing color strip)
invoice.php code, lines 157-181:
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
echo ' <tr class="dataTableRow">' . "\n" .
' <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
' <td class="dataTableContent" valign="top">' . $order->products[$i]['name'];
if (isset($order->products[$i]['attributes']) && (($k = sizeof($order->products[$i]['attributes'])) > 0)) {
for ($j = 0; $j < $k; $j++) {
if ($order->products[$i]['attributes'][$j]['price'] != '0'
or $order->products[$i]['attributes'][$j]['option'] == 'Personalize'
or $order->products[$i]['attributes'][$j]['option'] == 'Full size or motorcycle size?'
or $order->products[$i]['attributes'][$j]['option'] == 'Top Strip'
or $order->products[$i]['attributes'][$j]['option'] == 'Bottom Strip'
or $order->products[$i]['attributes'][$j]['option'] == 'Frame Color'
or $order->products[$i]['attributes'][$j]['option'] == 'Color Engravable Strip'
or $order->products[$i]['attributes'][$j]['option'] == 'Purchase as Combo Package & Save'
or $order->products[$i]['attributes'][$j]['option'] == 'Comments'
or $order->products[$i]['attributes'][$j]['option'] == 'Select lettering color'
or $order->products[$i]['attributes'][$j]['option'] == 'Logo or Lettering Color'
or $order->products[$i]['attributes'][$j]['option'] == 'Background Color'
or $order->products[$i]['attributes'][$j]['option'] == 'Line 1'
or $order->products[$i]['attributes'][$j]['option'] == 'Line 2'
or $order->products[$i]['attributes'][$j]['option'] == 'Line 3'
or $order->products[$i]['attributes'][$j]['option'] == 'Color of the Tag'
or $order->products[$i]['attributes'][$j]['option'] == "Background Color for Logo's"
or $order->products[$i]['attributes'][$j]['option'] == 'Silver or Gold Lettering')
echo '<br><br /><large> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));