Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Sorting Invoice / Packing Slip By Product Code? Help Appreciated. Rate Topic   - - - - -

 
  • CybrWzrd7
  • Newbie
  • Members
  • Join Date: 18-Oct 16
  • 3 posts

Posted 16 May 2019 - 04:15 PM #1

I cannot figure out how to sort the products on the invoice or packing slip by the product code instead of product name. I've searched endless forums, and I am starting to believe this is not simple.

I appreciate any solution offered for this in advance.

 

Thank you,

 



 
  • soft-solid
  • Junior Member
  • Members
  • Join Date: 19-Apr 10
  • 660 posts

Posted 16 May 2019 - 08:05 PM #2

Hello

 

The products on the invoice are sorted by name and this is directly entered in the function fn_get_order_info. You can not influence it in any way. You need to handle on hook in this function and once again take the products with sorting them as you like. You need to create a small addon.

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19158 posts

Posted 17 May 2019 - 05:53 AM #3

In the fn_get_order_info function (app/functions/fn.cart.php) use get_order_info hook to add the following line of code

$order['products'] = fn_sort_array_by_key($order['products'], 'product_code');

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • CybrWzrd7
  • Newbie
  • Members
  • Join Date: 18-Oct 16
  • 3 posts

Posted 17 May 2019 - 10:29 PM #4

Totally worked!

eCom Labs, I want you to be my new best friend. I owe you big time, thanks for the effort.

If there is a way I can bless you in return, let me know.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19158 posts

Posted 20 May 2019 - 05:45 AM #5

You are welcome! :)


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.