$attributes = array();
 // mc12345678 Moved to within if statement otherwise doesn't apply elsewhere.
 for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
     // kuroi: SbA //this bit of code does not seem to be used on this page, need to see if it is dead code or used elseware!
     $option_name_array = explode(":", $order->products[$i]['attributes'][$j]['option']);
     $option_Name = $option_name_array[0];
     // end: sbA
     //"Stock by Attributes" add custom ID to display
     $customid = null;
     //test if this is to be displayed
     if (STOCK_SBA_DISPLAY_CUSTOMID == 'true') {
         //create array for use in zen_get_customid
         $attributes[] = $order->products[$i]['attributes'][$j]['value_id'];
         //get custom ID
         sort($attributes);
         $customid = $stock->zen_get_customid($order->products[$i]['id'], $attributes);
         //only display custom ID if exists
         if (!empty($customid) && $j == $k - 1) {
             //add name prefix (this is set in the admin language file)
             $customid = PWA_CUSTOMID_NAME . $customid;
         } else {
             $customid = '';
         }
     }
     // END "Stock by Attributes"
     echo '<br /><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
     //"Stock by Attributes" add custom ID to display
     echo zen_not_null($customid) ? ' (' . $customid . ') ' : '';
     // END "Stock by Attributes"
     if ($order->products[$i]['attributes'][$j]['price'] != '0') {
         echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';