If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Customization from the Admin / adding product attributes to invoice

adding product attributes to invoice

Started by alpaf on 14 Dec 2012, 5:48 PM · Views: 760

Results 1 to 4 of 4
14 Dec 2012, 5:48 PM
#1
alpaf avatar

alpaf

New Zenner

Join Date:
Nov 2012
Posts:
7
Plugin Contributions:
0

Post #1 by alpaf

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']));

14 Dec 2012, 6:20 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #2 by ajeh

And if you add to your custom code:

or $order->products[$i]['attributes'][$j]['option'] == 'Color Strip'

does it now display?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

14 Dec 2012, 6:36 PM
#3
alpaf avatar

alpaf

New Zenner

Join Date:
Nov 2012
Posts:
7
Plugin Contributions:
0

Post #3 by alpaf

It did! And I was able to use the same idea to add a few other missing attributes. Thank you!

14 Dec 2012, 6:39 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #4 by ajeh

Are you filtering the Attributes for a reason rather than just show them all? :lookaroun

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!