Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

oyster.collector

Archived
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Real Name
    Dexter Oyster

Recent Profile Visitors

3,806 profile views

oyster.collector's Achievements

  1. @andrew You're welcome.. :) @jstark The code is for sorting under packing or invoice printing list. It sorts the products in an order via its attributes. I do not quite understand what you mean by products_model field. Is this a custom field under your products for an order?
  2. Hello andrew71, The batch print gets its orders data direct from the database. You can add those extra fields in the sql query in this line, $orders_query = tep_db_query("select o.invoice_serial, o.invoice_number, o.orders_id,h.comments,MIN(h.date_added) from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS_HISTORY . " h where h.orders_id = o.orders_id" . $pull_w_status . $get_customer_comments . ' group by o.orders_id'); This is line 79 in my batch_print.php under admin/. Cheers! :)
  3. @josemanuel yes, there is a way to sort the attributes in alphabetical or reverse order.. this is a little array manipulation, just insert this code between the if and for.. if ( ($k = sizeof($order->products[$i]['attributes'])) > 0) { // begin insert // Obtain a list of columns // option // value // price // prefix $sort_options = array(); $sort_values = array(); $sort_prices = array(); $sort_prefixes = array(); foreach ($order->products[$i]['attributes'] as $key => $row) { $sort_options[$key] = $row['option']; $sort_values[$key] = $row['value']; $sort_prices[$key] = $row['price']; $sort_prefixes[$key] = $row['prefix']; } // Sort the data with descending, ascending, etc. // Add $data as the last parameter, to sort by the common key array_multisort( $sort_options, SORT_DESC, $sort_values, SORT_ASC, $sort_prices, SORT_ASC, $sort_prefixes, SORT_ASC, $order->products[$i]['attributes']); // end insert for ($j = 0; $j < $k; $j++) { $attrib_string = '<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value']; if ($order->products[$i]['attributes'][$j]['price'] != '0') { $attrib_string .= ' (' . $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']) . ')'; } $attrib_string .= '</i>'; you can change the SORT_ASC or SORT_DESC to suit your needs.. :thumbsup:
  4. hey there, i've posted a fix for this missing print label bug.. you can check out the fix at my blog, i've uploaded the files there. i basically just modified the print_address function at the bottom of the batch_print.php.. have fun! :thumbsup:
×
×
  • Create New...